home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / tge132 / tge.doc < prev    next >
Encoding:
Text File  |  1994-05-21  |  126.7 KB  |  2,614 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                The Graphics Engine version 1.32 Documentation
  7.                                 21 May 1994
  8.  
  9.                 The Graphics Engine software and manual are
  10.                Copyright (c) 1993-1994 by Matthew Hildebrand.
  11.                             All rights reserved.
  12.  
  13.  
  14.  
  15.  
  16. Topics covered in this document:
  17. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  18.  
  19.      INTRODUCTION
  20.      WHY USE TGE?
  21.      TERMS OF USAGE AND DISTRIBUTION
  22.      SYSTEM REQUIREMENTS
  23.      PACKING LIST
  24.      RELEASE NOTES FOR VERSION 1.32
  25.      A CRASH COURSE IN GRAPHICS PROGRAMMING
  26.      USING TGE IN A PROGRAM
  27.      TGE'S GRAPHICAL FUNCTION SET
  28.      VIEWPORTS AND CLIPPING
  29.      VIRTUAL COORDINATES
  30.      VIRTUAL SCREENS
  31.      GRAPHICAL OUTPUT MODES
  32.      USING FONTS
  33.      BITMAP MANIPULATION
  34.      PALETTE MANIPULATION
  35.      USING THE MOUSE
  36.      TGE'S MOUSE FUNCTION SET
  37.      ADDITIONAL FEATURES IN THE REGISTERED VERSION
  38.      CREATING FONTS
  39.      USING PCX2RAW AND GRAPHICS FILES
  40.      CONTACTING THE AUTHOR
  41.      OBTAINING THE NEWEST VERSION OF TGE
  42.      KNOWN PROBLEMS USING TGE
  43.      ACKNOWLEDGEMENT
  44.      LEGAL STUFF
  45.  
  46.  
  47.  
  48.  
  49. INTRODUCTION
  50. ▀▀▀▀▀▀▀▀▀▀▀▀
  51.  
  52.      The Graphics Engine is the result of my efforts to construct a library
  53.      of routines designed to make writing C/C++ graphics applications
  54.      easier.  I have used it in my own programs with excellent results.
  55.  
  56.      TGE allows the DOS programmer to easily access many graphics modes,
  57.      without having to do special coding for each; the complications
  58.      involved with supporting more than one graphics mode are removed.  TGE
  59.      also provides remarkable flexibility and expandability through its
  60.      modular design.
  61.  
  62.  
  63.  
  64. WHY USE TGE?
  65. ▀▀▀▀▀▀▀▀▀▀▀▀
  66.  
  67.      TGE provides a simple, standard interface with which programs may
  68.      access a powerful library of graphical functions.  TGE supports
  69.      device-independence through the use of loadable drivers; loadable
  70.      fonts; viewports; virtual screens of definable sizes; graphics output
  71.      using COPY, AND, NOT, OR, and XOR, even to virtual screens; bitmap
  72.      scaling; interrupt-driven, definable mouse pointer services; direct
  73.      manipulation of PCX, RAW, and PAL files; and a virtual coordinate
  74.      system to make device-independence easier.
  75.  
  76.      TGE's use of loadable graphics drivers means that all code and data
  77.      necessary to handle any given graphics mode is stored in a disk file.
  78.      When a program runs, this file will be loaded into memory and the code
  79.      and data it contains will be made available.  Consequently:
  80.           - Support for more graphics modes may be added simply by creating
  81.             more drivers; programs need not be recompiled.
  82.           - Since the code to manage the specifics of each mode is
  83.             contained in the drivers, the main program needs not concern
  84.             itself with what mode it is operating in.  The same code can
  85.             work in any graphics mode.
  86.           - Memory is saved for programs which support many graphics modes.
  87.             Instead of keeping the code and data necessary for each in
  88.             memory at all times, only the memory required for one driver is
  89.             used.
  90.  
  91.      The names of TGE's functions, such as "putImage" and "filledRect", may
  92.      easily be changed to suit individual preferences.
  93.  
  94.      TGE is powerful, fast, and cheap.  Upgrades are free.
  95.  
  96.  
  97.  
  98. TERMS OF USAGE AND DISTRIBUTION
  99. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  100.  
  101.      TGE is not free; it is distributed on a "try before you buy" basis.
  102.      Permission is granted to use TGE, for evaluation purposes only, for a
  103.      trial period of up to 30 days.  In order to use TGE after the trial
  104.      period, you MUST REGISTER; registration entitles you to free upgrades,
  105.      technical support, royalty-free distribution rights for all software
  106.      written using TGE, and a copy of the registered version of TGE, which
  107.      includes TGE's complete source code, an extra font, and features not
  108.      available in the shareware version.  Failure to register constitutes
  109.      theft and is punishable by law.
  110.  
  111.      By registering a copy of TGE, you signify that you have read and
  112.      understood the terms of usage and distribution explained in this
  113.      document, and that you agree to be bound by these terms; you also
  114.      signify that you agree to release the Author (Matthew Hildebrand) from
  115.      all liability associated with the use of TGE.
  116.  
  117.      In order to register a copy of TGE, send $30 US funds or $40 Canadian
  118.      funds to Matthew Hildebrand at the address listed in the CONTACTING
  119.      THE AUTHOR section of this document.  For each software package which
  120.      is both distributed by a corporation and built using TGE, send an
  121.      additional $100 US funds or $130 Canadian funds (negotiable); this fee
  122.      is a pittance compared to the revenue generated by typical commercial
  123.      packages.  Payment by money order, cheque, or cash is acceptable;
  124.      currency must be US or Canadian funds.  Users outside the USA and
  125.      Canada, please ensure that cheques are drawn on a US or Canadian bank,
  126.      and that money orders are international if necessary.  Also, please
  127.      send a filled out copy of ORDER.FRM with your payment.  Thank you in
  128.      advance for registering TGE; your support is what makes its continued
  129.      growth possible.
  130.  
  131.      Upon receipt of your registration, I will mail you a copy of the
  132.      registered version of TGE, which includes complete source code, an
  133.      extra font, and features not available in the shareware version; this
  134.      registered copy of TGE may not be distributed in any way.  Once I have
  135.      mailed you a copy of the registered version, you will be considered a
  136.      registered user.  If you are interested in receiving notifications of
  137.      new versions as they are released, or copies of the new versions
  138.      themselves, refer to paragraph two of the OBTAINING THE NEWEST VERSION
  139.      OF TGE section.
  140.  
  141.      The privileges granted by purchasing TGE may be retracted if any of
  142.      the copyright notices in TGE's source files is modified or removed, if
  143.      any or all of the registered version of TGE is distributed in any way,
  144.      or if any or all of TGE's source code is distributed as part of a
  145.      software package.
  146.  
  147.      The shareware version of TGE may be distributed freely as long as the
  148.      distributed package is complete and its contents are not modified in
  149.      any way, and the distributed package is not sold for profit.
  150.  
  151.  
  152.  
  153. SYSTEM REQUIREMENTS
  154. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  155.  
  156.      TGE is a C/C++ programmer's library.  As such, it requires a C or C++
  157.      compiler of some sort to work with it.  TGE was written and tested
  158.      with Borland C++ 2.0 and Turbo C 2.0; it may work with other C/C++
  159.      compilers as well.
  160.  
  161.      The drivers that come with TGE are written using 80386 instructions;
  162.      they therefore cannot be used on a processor older than the 386 unless
  163.      they are modified first.
  164.  
  165.      The font and virtual coordinate systems are written in C++, not C.  In
  166.      order to use loadable fonts or VCOORD.H, a C++ compiler will be
  167.      required.
  168.  
  169.  
  170.  
  171. PACKING LIST
  172. ▀▀▀▀▀▀▀▀▀▀▀▀
  173.  
  174.      The current version of TGE consists of the following files:
  175.  
  176.      \TGE\               <DIR>
  177.          TGE.DOC                   TGE documentation.
  178.          QUICKREF.DOC              TGE function library quick reference.
  179.          REVISION.HST              Revision history.
  180.          ORDER.FRM                 Order form (shareware version only).
  181.          UNIVESA.DOC               Universal VESA TSR documentation.
  182.          UNIVESA.EXE               Universal VESA TSR executable.
  183.          README.NOW                Important information.
  184.          FILE_ID.DIZ               Archive description file used by some
  185.                                      bulletin board systems (shareware
  186.                                      version only).
  187.      \TGE\INCLUDE\       <DIR> TGE include files.
  188.          TGE.H                     TGE main header file.
  189.          FIXFONT.H                 Fixed-size font header file (C++).
  190.          VARFONT.H                 Variable-sized font header file (C++).
  191.          TGEMOUSE.H                Mouse header file.
  192.          VCOORD.H                  Virtual coordinate system (C++).
  193.        \TGE\LIB\         <DIR> Library directory.
  194.          BCL.MAK                   Makefile for Borland C++ large model
  195.                                      library.
  196.          BCH.MAK                   Makefile for Borland C++ huge model
  197.                                      library.
  198.          TGELIB.LST                Listfile used by library makefiles.
  199.          BCL.LIB                   Borland C++ large model library.
  200.          BCH.LIB                   Borland C++ huge model library.
  201.        \TGE\UTIL\        <DIR> PCX2RAW and MAKEFONT utilitites.
  202.          PCX2RAW.C                 Source for PCX2RAW.
  203.          PCX2RAW.EXE               Convert PCX files to RAW and PAL files.
  204.          MAKEFONT.C                Source for MAKEFONT.
  205.          MAKEFONT.EXE              Make a font from individual bitmaps.
  206.        \TGE\DRIVERS\     <DIR> Loadable drivers.
  207.          320X200.DRV               Driver for VGA 320x200x256.
  208.          320X240.DRV               Driver for VGA 320x240x256.
  209.          320X400.DRV               Driver for VGA 320x400x256.
  210.          360X480.DRV               Driver for VGA 360x480x256.
  211.          640X480.DRV               Driver for SuperVGA 640x480x256.
  212.          800X600.DRV               Driver for SuperVGA 800x600x256.
  213.          1024X768.DRV              Driver for SuperVGA 1024x768x256.
  214.        \TGE\FONTS\       <DIR> Loadable fonts.
  215.          BIGTEXT.FNT               Big letters (variable-sized).
  216.          8X8.FNT                   8x8 font (fixed-size).
  217.          8X14.FNT                  8x14 font (fixed-size).
  218.          8X16.FNT                  8x16 font (fixed-size).
  219.        \TGE\DEMO\        <DIR> Demo programs.
  220.          TGEDEMO.DOC               Documentation for demo program.
  221.          TGEDEMO.CPP               Source code for demo program.
  222.          MAKEFILE                  Makefile for the demo program.
  223.          TGEDEMO.EXE               TGE demo program executable.
  224.          TGELOGO.RAW               Data file used by the TGE demo program.
  225.          SIMPLE.CPP                A skeleton TGE program showing interface
  226.                                      basics.
  227.  
  228.      If you did not receive all of these files, you have an illegal copy of
  229.      The Graphics Engine.
  230.  
  231.  
  232.  
  233. RELEASE NOTES FOR VERSION 1.32
  234. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  235.  
  236.      You may have trouble using the C++ portions of TGE; if so, the linker
  237.      will report that member functions cannot be found in the library.  In
  238.      order to remedy this problem, be sure that you have the "Unsigned
  239.      characters" option disabled, or just cast all parameters to the font
  240.      load() routines to signed char.  To disable this option from the IDE,
  241.      just use the menus; the command line option needed is "-K-" (the
  242.      default).  It is possible that you may have to enable the "Far virtual
  243.      tables" option ("-Vf" from the command line), but it is unlikely.
  244.  
  245.      For a complete list of changes, refer to the REVISION.HST file.
  246.  
  247.      The drivers used with this release are not compatible with those from
  248.      version 1.31 or older, since changes have been made to the driver
  249.      structure in order to allow for new features.
  250.  
  251.  
  252.  
  253. A CRASH COURSE IN GRAPHICS PROGRAMMING
  254. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  255.  
  256.      A graphics screen is composed of thousands or even hundreds of
  257.      thousands of coloured dots called "pixels".  Each pixel is referenced
  258.      according to its offset, in coordinate form, from the upper-left of
  259.      the screen:  (0,0), or the "origin".  The 'x' of a pixel's (x,y)
  260.      location signifies the column number, and the 'y' signifies the row
  261.      number; for example, a 640x480 screen would have (0,0) in the upper-
  262.      left and (639,479) in the lower-right.
  263.  
  264.      Each of these pixels has a colour which is recorded as a number,
  265.      ranging from 0..255 in 256-colour modes.  Each of these numbers is an
  266.      index into a table of colours which the video card maintains:  the
  267.      "palette".  The palette is what determines which colour is represented
  268.      by certain numbers; for instance, what colour is colour number 196?
  269.      Blue?  Green?  Purple?  It depends on the current setting of the
  270.      palette register for colour number 196.
  271.  
  272.      Each of these palette registers consists of three components:  the
  273.      red, green, and blue values, each of which is in the range 0..255.
  274.      All the displayable colours are composed of these three primary
  275.      colours in some proportion.  For instance, a purple would have lots of
  276.      red and blue, but little or no green.
  277.  
  278.      The palette can be a powerful tool, as changing palette register, say,
  279.      48, causes all pixels on-screen with the value of 48 to instantly
  280.      change to the new colour.  It is important to keep in mind that the
  281.      palette is a global palette; ie. it affects the entire screen.
  282.  
  283.      That's all there is to it!  <grin>
  284.  
  285.  
  286.  
  287. USING TGE IN A PROGRAM
  288. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  289.  
  290.      TGE now uses two environment variables:  TGEDRIVERS and TGEFONTS.
  291.      Though these environement variables are not necessary, it is
  292.      recommended that you add the following lines to your AUTOEXEC.BAT
  293.      file:
  294.           set TGEDRIVERS=drive:\tge\drivers\
  295.           set TGEFONTS=drive:\tge\fonts\
  296.      where 'drive:' is the drive on which you installed TGE.  The trailing
  297.      backslash is required.
  298.  
  299.  
  300.      Incorporating TGE into a program is an easy process involving three
  301.      simple steps.  First, you must be sure that TGE is recognized by the
  302.      program; to do so, #include the header file TGE.H into any source file
  303.      which accesses any of TGE's routines; you may also need to #include
  304.      other header files, such as TGEMOUSE.H if you use TGE's mouse code.
  305.      Also, ensure that the appropriate library file is linked in with the
  306.      program's OBJ files to make the EXE file; available library files are
  307.      BCL.LIB (Borland C++ large model) and BCH.LIB (Borland C++ huge
  308.      model).
  309.  
  310.      Second, a graphics driver MUST be loaded before any code or data
  311.      contained in the driver is accessed; results are undefined (though
  312.      almost certainly bad) if this step is not taken.  Code to load a
  313.      driver might look like this:
  314.  
  315.           if (loadGraphDriver(drvFileName) != TGE_SUCCESS)
  316.           {
  317.             printf("Error loading driver %s; aborting.\n\n", drvFileName);
  318.             exit(EXIT_FAILURE);
  319.           }
  320.           else
  321.             atexit(unloadGraphDriver);
  322.  
  323.      As its only parameter, loadGraphDriver() takes a string consisting of
  324.      the file name (which may include any valid DOS path) of the driver to
  325.      be loaded; note that if the specified filename cannot be found, TGE
  326.      will attempt to load it from the directory specified by the TGEDRIVERS
  327.      environment variable.  loadGraphDriver() returns TGE_SUCCESS if the
  328.      loading was successful, or one of TGE_OPEN_ERR (file not found),
  329.      TGE_FORMAT_ERR (file is not a valid TGE driver), TGE_ALLOC_ERR (out of
  330.      memory), and TGE_FILE_ERR (general file I/O error) if an error
  331.      occurred.  These macros are defined in TGE.H.
  332.  
  333.      Third, after TGE's graphical functions are no longer needed (usually
  334.      just before a program exit), the function unloadGraphDriver() should
  335.      be called.  It takes no parameters, and returns nothing.  It simply
  336.      frees the memory taken up by a driver after it has been loaded.  (With
  337.      some compilers it is not necessary to call this function, but it's
  338.      safer to call it just to be sure.)  It is generally a good idea to
  339.      place unloadGraphDriver() in the atexit() queue, as was done in the
  340.      above code fragment.
  341.  
  342.  
  343.      Note that the initGraphics() function must be called to enter graphics
  344.      mode; for more information, see the next section.  For more
  345.      information on how to use any particular feature, refer to the
  346.      appropriate section of this document.
  347.  
  348.  
  349.  
  350. TGE'S GRAPHICAL FUNCTION SET
  351. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  352.  
  353.      After a driver has been loaded, all of TGE's graphical functions can
  354.      be accessed.  To call a function, simply execute
  355.  
  356.           functionName(parameter_list);
  357.  
  358.      where "functionName" is the name of the desired function (eg.
  359.      "ellipse" or "filledRect") and "parameter_list" is all parameters to
  360.      that function, if any.
  361.  
  362.      A complete list of TGE's graphical functions follows.
  363.  
  364.  
  365.  *** Function:      initGraphics()
  366.      Syntax:        void initGraphics(void);
  367.      Purpose:       Initialize graphics mode.
  368.      Parameters:    None.
  369.      Return value:  1 on success or 0 on error.
  370.      Remarks:       None.
  371.      See also:      deInitGraphics()
  372.  
  373.  *** Function:      deInitGraphics()
  374.      Syntax:        void deInitGraphics(void);
  375.      Purpose:       Revert to 80x25 colour text mode.
  376.      Parameters:    None.
  377.      Return value:  None.
  378.      Remarks:       None.
  379.      See also:      initGraphics()
  380.  
  381.  *** Function:      putImage()
  382.      Syntax:        void huge putImage(int x, int y, void far *image);
  383.      Purpose:       Place a bitmap, or image, onto the screen.
  384.      Parameters:    The bitmap contained in 'image' will be placed onto the
  385.                     screen with its upper-left coordinate at ('x','y').
  386.      Return value:  None.
  387.      Remarks:            Clipping is performed; the image may be placed
  388.                     entirely on-screen, partially on-screen, or entirely
  389.                     off-screen.
  390.                          This function is declared as huge so that it will
  391.                     work properly when called from within an interrupt
  392.                     service routine.
  393.      See also:      putImageInv(), getImage(), imageSize(), imageSizeDim(),
  394.                     putHorizLine(), putHorizLineInv(), getHorizLine()
  395.  
  396.  *** Function:      putImageInv()
  397.      Syntax:        void huge putImageInv(int x, int y, void far *image);
  398.      Purpose:       Place a bitmap, or image, on the screen.
  399.      Parameters:    The bitmap contained in 'image' will be placed onto the
  400.                     screen with its upper-left coordinate at ('x','y').
  401.      Return value:  None.
  402.      Remarks:            Clipping is performed; the image may be placed
  403.                     entirely on-screen, partially on-screen, or entirely
  404.                     off-screen.    putImageInv() differs from putImage()
  405.                     only in that it allows for transparent, or invisible,
  406.                     colours.  If any pixel in the image buffer has a value
  407.                     of zero, the corresponding pixel on-screen will not be
  408.                     modified.  Using putImageInv() can avoid having black
  409.                     borders around non-rectangular shapes.
  410.                          This function is declared as huge so that it will
  411.                     work properly when called from within an interrupt
  412.                     service routine.
  413.      See also:      putImage(), getImage(), imageSize(), imageSizeDim(),
  414.                     putHorizLineInv(), putHorizLine(), getHorizLine()
  415.  
  416.  *** Function:      getImage()
  417.      Syntax:        void huge getImage(int ulx, int uly, int lrx, int lry,
  418.                     void far *image);
  419.      Purpose:       Copy the specified rectangular portion of the screen to
  420.                     memory.
  421.      Parameters:    The portion of the screen with its upper-left
  422.                     coordinate at ('ulx','uly') and its lower-left
  423.                     coordinate at ('lrx','lry') will be copied into the
  424.                     previously allocated memory region at 'image' (see
  425.                     imageSize()).
  426.      Return value:  None.
  427.      Remarks:            Clipping is performed.  Note that only the portion
  428.                     of the specified region which lies within the current
  429.                     viewport will be placed in the image buffer by
  430.                     getImage().  Be careful not to assume that a getImage()
  431.                     image has off-screen data in it.
  432.                          This function is declared as huge so that it will
  433.                     work properly when called from within an interrupt
  434.                     service routine.
  435.      See also:      putImage(), putImageInv(), imageSize(), imageSizeDim(),
  436.                     getHorizLine(), putHorizLine(), putHorizLineInv()
  437.  
  438.  *** Function:      imageSize()
  439.      Syntax:        unsigned long imageSize(int ulx, int uly, int lrx, int
  440.                     lry);
  441.      Purpose:       Determine the amount of memory required to hold a
  442.                     rectangular portion of the screen.
  443.      Parameters:    imageSize() will calculate the amount of memory
  444.                     required to hold the porion of the screen whose upper-
  445.                     left coordinate is ('ulx','uly') and whose lower-left
  446.                     coordinate is ('lrx','lry').
  447.      Return value:  imageSize returns an unsigned long containing the size
  448.                     of the area in bytes.
  449.      Remarks:            Clipping is performed.
  450.                          imageSize() is designed for use with putImage(),
  451.                     putImageInv(), and getImage().  To use it with
  452.                     putHorizLine() and getHorizLine(), subtract 4 from the
  453.                     value it returns.  (Image buffers have four bytes of
  454.                     dimension information in them; line buffers do not.)
  455.      See also:      imageSizeDim(), putImage(), putImageInv(), getImage(),
  456.                     putHorizLine(), getHorizLine()
  457.  
  458.  *** Function:      imageSizeDim()
  459.      Syntax:        unsigned long imageSizeDim(unsigned wide, unsigned
  460.                     deep);
  461.      Purpose:       Determine the amount of memory required to hold a
  462.                     rectangular portion of the screen.
  463.      Parameters:    imageSize() will calculate the amount of memory
  464.                     required to hold the porion of the screen with width
  465.                     'wide' and depth 'deep'.
  466.      Return value:  imageSize returns an unsigned long containing the size
  467.                     of the area in bytes.
  468.      Remarks:            Clipping is not performed.
  469.                          imageSizeDim() is designed for use with
  470.                     putImage(), putImageInv(), and getImage().  To use it
  471.                     with putHorizLine() and getHorizLine(), subtract 4 from
  472.                     the value it returns.  (Image buffers have four bytes
  473.                     of dimension information in them; line buffers do not.)
  474.      See also:      imageSize(), putImage(), putImageInv(), getImage(),
  475.                     putHorizLine(), getHorizLine()
  476.  
  477.  *** Function:      putHorizLine()
  478.      Syntax:        void putHorizLine(int y, int xOff, int lineLen, void
  479.                     far *buf);
  480.      Purpose:       Place one horizontal line of image data on the screen.
  481.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  482.                     pixels, will be placed on-screen starting at
  483.                     ('xOff','y').
  484.      Return value:  None.
  485.      Remarks:       No clipping is performed.  Results are undefined if any
  486.                     coordinate on the line is off-screen.
  487.      See also:      putHorizLineInv(), getHorizLine(), putImage(),
  488.                     putImageInv(), getImage()
  489.  
  490.  *** Function:      putHorizLineInv()
  491.      Syntax:        void putHorizLineInv(int y, int xOff, int lineLen, void
  492.                     far *buf);
  493.      Purpose:       Place one horizontal line of image data on the screen,
  494.                     leaving a pixel unchanged if the corresponding pixel in
  495.                     the source buffer has a value of zero.
  496.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  497.                     pixels, will be placed on-screen starting at
  498.                     ('xOff','y').
  499.      Return value:  None.
  500.      Remarks:       No clipping is performed.  Results are undefined if any
  501.                     coordinate on the line is off-screen.
  502.      See also:      putHorizLine(), getHorizLine(), putImage(),
  503.                     putImageInv(), getImage()
  504.  
  505.  *** Function:      getHorizLine()
  506.      Syntax:        void getHorizLine(int y, int xOff, int lineLen, void
  507.                     far *buf);
  508.      Purpose:       Copy one horizontal line from the screen to memory.
  509.      Parameters:    The horizontal line whose left coordinate is
  510.                     ('xOff','y') and whose length is 'lineLen' pixels will
  511.                     be copied into the previously allocated memory region
  512.                     at 'buf'.
  513.      Return value:  None.
  514.      Remarks:       No clipping is performed.  Results are undefined if any
  515.                     coordinate on the line is off-screen.
  516.      See also:      putHorizLine(), putHorizLineInv(), putImage(),
  517.                     putImageInv(), getImage()
  518.  
  519.  *** Function:      putVertLine()
  520.      Syntax:        void putVertLine(int y, int xOff, int lineLen, void far
  521.                     *buf);
  522.      Purpose:       Place one vertical line of image data on the screen.
  523.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  524.                     pixels, will be placed on-screen starting at
  525.                     ('x','yOff').
  526.      Return value:  None.
  527.      Remarks:       No clipping is performed.  Results are undefined if any
  528.                     coordinate on the line is off-screen.
  529.      See also:      putVertLineInv(), getVertLine(), putImage(),
  530.                     putImageInv(), getImage()
  531.  
  532.  *** Function:      putVertLineInv()
  533.      Syntax:        void putVertLineInv(int y, int xOff, int lineLen, void
  534.                     far *buf);
  535.      Purpose:       Place one vertical line of image data on the screen,
  536.                     leaving a pixel unchanged if the corresponding pixel in
  537.                     the source buffer has a value of zero.
  538.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  539.                     pixels, will be placed on-screen starting at
  540.                     ('x','yOff').
  541.      Return value:  None.
  542.      Remarks:       No clipping is performed.  Results are undefined if any
  543.                     coordinate on the line is off-screen.
  544.      See also:      putVertLine(), getVertLine(), putImage(),
  545.                     putImageInv(), getImage()
  546.  
  547.  *** Function:      getVertLine()
  548.      Syntax:        void getVertLine(int y, int xOff, int lineLen, void far
  549.                     *buf);
  550.      Purpose:       Copy one vertical line from the screen to memory.
  551.      Parameters:    The vertical line whose left coordinate is ('x','yOff')
  552.                     and whose length is 'lineLen' pixels will be copied
  553.                     into the previously allocated memory region at 'buf'.
  554.      Return value:  None.
  555.      Remarks:       No clipping is performed.  Results are undefined if any
  556.                     coordinate on the line is off-screen.
  557.      See also:      putVertLine(), putVertLineInv(), putImage(),
  558.                     putImageInv(), getImage()
  559.  
  560.  *** Function:      putPixel()
  561.      Syntax:        void putPixel(int x, int y, unsigned colour);
  562.      Purpose:       Place a single pixel on-screen.
  563.      Parameters:    The pixel located at ('x','y') will be set to the
  564.                     colour 'colour'.
  565.      Return value:  None.
  566.      Remarks:       Clipping is not performed; see clipPoint() and
  567.                     pointOnScreen() for details on clipping pixels.
  568.      See also:      getPixel()
  569.  
  570.  *** Function:      getPixel()
  571.      Syntax:        unsigned getPixel(int x, int y);
  572.      Purpose:       Return the value of a pixel.
  573.      Parameters:    The value of the pixel at ('x','y') is returned.
  574.      Return value:  The value of the pixel at ('x','y') is returned.
  575.      Remarks:       Clipping is not performed; see clipPoint() and
  576.                     pointOnScreen() for details on clipping pixels.
  577.      See also:      putPixel()
  578.  
  579.  *** Function:      line()
  580.      Syntax:        void line(int x1, int y1, int x2, int y2, unsigned
  581.                     colour);
  582.      Purpose:       Draw a line between two points.
  583.      Parameters:    The line will be drawn joining ('x1','y1') and
  584.                     ('x2','y2') in the colour 'colour'.
  585.      Return value:  None.
  586.      Remarks:       Clipping is not performed; see clipLine() for details
  587.                     on clipping lines.
  588.      See also:      horizLine(), vertLine()
  589.  
  590.  *** Function:      horizLine()
  591.      Syntax:        void horizLine(int y, int x1, int x2, unsigned colour);
  592.      Purpose:       Draw a horizontal line between two points.
  593.      Parameters:    The line will be drawn between ('x1','y') and
  594.                     ('x2','y') in the colour contained in colour.
  595.      Return value:  None.
  596.      Remarks:            Clipping is not performed.
  597.                          'x1' must be less than or equal to 'x2'.
  598.      See also:      vertLine(), line()
  599.  
  600.  *** Function:      vertLine()
  601.      Syntax:        void vertLine(int x, int y1, int y2, unsigned colour);
  602.      Purpose:       Draw a vertical line between two points.
  603.      Parameters:    The line will be drawn between ('x','y1') and
  604.                     ('x','y2') in the colour contained in colour.
  605.      Return value:  None.
  606.      Remarks:            Clipping is not performed.
  607.                          'y1' must be less than or equal to 'y2'.
  608.      See also:      horizLine(), line()
  609.  
  610.  *** Function:      drawRect()
  611.      Syntax:        void drawRect(int ulx, int uly, int lrx, int lry,
  612.                     unsigned colour);
  613.      Purpose:       Draw a rectangle.
  614.      Parameters:    The rectangle will be drawn with its upper-left
  615.                     coordinates at ('ulx','uly') and its lower-left
  616.                     coordinates at ('lrx','lry'), in the colour 'colour'.
  617.      Return value:  None.
  618.      Remarks:       Clipping is performed.
  619.      See also:      filledRect()
  620.  
  621.  *** Function:      filledRect()
  622.      Syntax:        void filledRect(int ulx, int uly, int lrx, int lry,
  623.                     unsigned colour);
  624.      Purpose:       Draw a filled rectangle.
  625.      Parameters:    The rectangle will be drawn with its upper-left
  626.                     coordinates at ('ulx','uly') and its lower-left
  627.                     coordinates at ('lrx','lry'), in the colour 'colour'.
  628.      Return value:  None.
  629.      Remarks:       Clipping is not performed; see clipFilledRect() for
  630.                     details on clipping filledRects.
  631.      See also:      drawRect()
  632.  
  633.  *** Function:      setPaletteReg()
  634.      Syntax:        void setPaletteReg(unsigned palReg, unsigned char red,
  635.                     unsigned char green, unsigned char blue);
  636.      Purpose:       Set a palette register.
  637.      Parameters:    The red, green, and blue components of the palette
  638.                     register palReg will be set to 'red', 'green', and
  639.                     'blue' respectively.
  640.      Return value:  None.
  641.      Remarks:       Each of the colour components ('red', 'green', 'blue')
  642.                     should be in the range 0..255, not 0..63 as would be
  643.                     the case using a stock VGA.  The drivers will take care
  644.                     of converting 8-bit to 6-bit palette resolution if
  645.                     necessary.
  646.      See also:      getPaletteReg(), setBlockPalette(), getBlockPalette()
  647.  
  648.  *** Function:      getPaletteReg()
  649.      Syntax:        void getPaletteReg(unsigned palReg, unsigned char far
  650.                     *red, unsigned char far *green, unsigned char far
  651.                     *blue);
  652.      Purpose:       Return the current settings of a palette register.
  653.      Parameters:    The red, green, and blue contents of the palette
  654.                     register palReg will be stored in 'red', 'green', and
  655.                     'blue' respectively.
  656.      Return value:  The red, green, and blue components of the palette
  657.                     register are returned in 'red', 'green', and 'blue'.
  658.      Remarks:       Each of the colour components ('red', 'green', 'blue')
  659.                     are in the range 0..255, not 0..63 as would be the case
  660.                     using a stock VGA card.  The drivers will take care of
  661.                     converting 8-bit to 6-bit palette resolution if
  662.                     necessary.
  663.      See also:      setPaletteReg(), setBlockPalette(), getBlockPalette()
  664.  
  665.  *** Function:      setBlockPalette()
  666.      Syntax:        void setBlockPalette(unsigned firstReg, unsigned
  667.                     lastReg, void far *data);
  668.      Purpose:       Set a block of palette registers.
  669.      Parameters:    The palette registers starting at 'firstReg' and ending
  670.                     at 'lastReg' will be set to the values contained in
  671.                     'data'.
  672.      Return value:  None.
  673.      Remarks:            The memory region at 'data' is organised in groups
  674.                     of three bytes; each group corresponds to one palette
  675.                     register, and each group is made up of, in order, the
  676.                     red, green, and blue components.  The first group is
  677.                     for the first register, the second for the second, and
  678.                     so on.
  679.                          Each of the colour components (red, green, blue)
  680.                     should be in the range 0..255, not 0..63 as would be
  681.                     the case using a stock VGA.  The drivers will take care
  682.                     of converting 8-bit to 6-bit palette resolution if
  683.                     necessary.
  684.                          Results are undefined if 'lastReg' is less than
  685.                     'firstReg'.
  686.      See also:      getBlockPalette(), setPaletteReg(), getPaletteReg()
  687.  
  688.  *** Function:      getBlockPalette()
  689.      Syntax:        void getBlockPalette(unsigned firstReg, unsigned
  690.                     lastReg, void far *data);
  691.      Purpose:       Get the values of a block of palette registers.
  692.      Parameters:    The values of the palette registers starting at
  693.                     'firstReg' and ending at 'lastReg' will be stored in
  694.                     the previously allocated 'data'.
  695.      Return value:  The values are returned in 'data'.
  696.      Remarks:            The memory region at 'data' is organised in groups
  697.                     of three bytes; each group corresponds to one palette
  698.                     register, and each group is made up of, in order, the
  699.                     red, green, and blue components.  The first group is
  700.                     for the first register, the second for the second, and
  701.                     so on.
  702.                          Each of the colour components (red, green, blue)
  703.                     is in the range 0..255, not 0..63 as would be the case
  704.                     using a stock VGA.  The drivers will take care of
  705.                     converting 8-bit to 6-bit palette resolution if
  706.                     necessary.
  707.                          Results are undefined if 'lastReg' is less than
  708.                     'firstReg'.
  709.      See also:      setBlockPalette(), setPaletteReg(), getPaletteReg()
  710.  
  711.  *** Function:      clearGraphics()
  712.      Syntax:        void clearGraphics(unsigned colour);
  713.      Purpose:       Clear the screen.
  714.      Parameters:    The screen will be cleared to the colour 'colour'.
  715.      Return value:  None.
  716.      Remarks:       This function clears the entire screen, not just the
  717.                     current viewport.
  718.      See also:      filledRect()
  719.  
  720.  *** Function:      ellipse()
  721.      Syntax:        void ellipse(int x, int y, int wide, int deep, unsigned
  722.                     colour);
  723.      Purpose:       Draw the outline of an ellipse.
  724.      Parameters:    An ellipse centered at ('x','y') and having width
  725.                     'wide' and depth 'deep' will be drawn in the colour
  726.                     'colour'.
  727.      Return value:  None.
  728.      Remarks:       Clipping is performed.
  729.      See also:      filledEllipse(), circle(), filledCircle()
  730.  
  731.  *** Function:      filledEllipse()
  732.      Syntax:        void filledEllipse(x, int y, int wide, int deep,
  733.                     unsigned colour);
  734.      Purpose:       Draw a filled ellipse.
  735.      Parameters:    An ellipse centered at ('x','y') and having width
  736.                     'wide' and depth 'deep' will be drawn in the colour
  737.                     'colour'.
  738.      Return value:  None.
  739.      Remarks:       Clipping is performed.
  740.      See also:      ellipse(), filledCircle(), circle()
  741.  
  742.  *** Function:      circle()
  743.      Syntax:        void circle(int x, int y, int radius, unsigned colour);
  744.      Purpose:       Draw the outline of a circle.
  745.      Parameters:    A circle centered at ('x','y') and having radius
  746.                     'radius' will be drawn in the colour 'colour'.
  747.      Return value:  None.
  748.      Remarks:            Clipping is performed.
  749.                          The 'radius' parameter is the radius in pixels
  750.                     measured horizontally.  Although there will be no
  751.                     difference in modes with square pixels, it will make a
  752.                     difference in other modes; to ensure accurate drawing
  753.                     of the circle with the given radius, make certain that
  754.                     the radius is measured horizontally.
  755.                          TGE uses an all-integer approach to coordinate
  756.                     scaling to ensure that the drawn shape will be circular
  757.                     in modes without square pixels.
  758.      See also:      filledCircle(), filledEllipse(), ellipse()
  759.  
  760.  *** Function:      filledCircle()
  761.      Syntax:        void filledCircle(int x, int y, int radius, unsigned
  762.                     colour);
  763.      Purpose:       Draw a filled circle.
  764.      Parameters:    A circle centered at ('x','y') and having radius
  765.                     'radius' will be drawn in the colour 'colour'.
  766.      Return value:  None.
  767.      Remarks:            Clipping is performed.
  768.                          The 'radius' parameter is the radius in pixels
  769.                     measured horizontally.  Although there will be no
  770.                     difference in modes with square pixels, it will make a
  771.                     difference in other modes; to ensure accurate drawing
  772.                     of the circle with the given radius, make certain that
  773.                     the radius is measured horizontally.
  774.                          TGE uses an all-integer approach to coordinate
  775.                     scaling to ensure that the drawn shape will be circular
  776.                     in modes without square pixels.
  777.      See also:      circle(), ellipse(), filledEllipse()
  778.  
  779.  *** Function:      fillRegion()
  780.      Syntax:        void fillRegion(int x, int y, unsigned colour);
  781.      Purpose:       Floods a region of the screen with the specified
  782.                     colour.
  783.      Parameters:    The fill will begin at the seed point ('x','y'), and
  784.                     will fill with the colour 'colour'.
  785.      Return value:  None.
  786.      Remarks:            The region to be filled is bounded by any colour
  787.                     not equal to the colour at ('x','y'); ie., the region
  788.                     to be filled consists of one colour only.
  789.                          Clipping is performed.
  790.      See also:      None.
  791.  
  792.  *** Function:      colourCloseTo()
  793.      Syntax:        unsigned colourCloseTo(unsigned char red, unsigned char
  794.                     green, unsigned char blue);
  795.      Purpose:       Given a 24-bit colour, find the colour from the current
  796.                     palette which most closely matches it.
  797.      Parameters:    The 24-bit colour is defined by the 'red', 'green', and
  798.                     'blue' parameters.
  799.      Return value:  Returns the colour which most closely matches the
  800.                     specified 24-bit colour.
  801.      Remarks:       None.
  802.      See also:      colourCloseToX()
  803.  
  804.  *** Function:      colourCloseToX()
  805.      Syntax:        unsigned colourCloseToX(unsigned char red, unsigned
  806.                     char green, unsigned char blue, unsigned
  807.                     colourExclude);
  808.      Purpose:       Given a 24-bit colour, find the colour from the current
  809.                     palette which most closely matches it, with the
  810.                     specified colour disallowed from the search.
  811.      Parameters:    The 24-bit colour is defined by the 'red', 'green', and
  812.                     'blue' parameters.  The colour 'colourExclude' is
  813.                     excluded from the search, and so will never be
  814.                     returned.
  815.      Return value:  Returns the colour which most closely matches the
  816.                     specified 24-bit colour.
  817.      Remarks:       Excluding zero from a search will ensure that the
  818.                     returned colour will be visible when it is used as part
  819.                     of a bitmap displayed using putImageInv().
  820.      See also:      colourCloseTo()
  821.  
  822.  
  823.      Note that since these function names are actually macros, they may
  824.      easily be changed to suit individual preferences by editing TGE.H.
  825.  
  826.  
  827.  
  828. VIEWPORTS AND CLIPPING
  829. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  830.  
  831.      A viewport is a rectangular region on the screen to which output is
  832.      clipped, so that graphics output will appear only within that region.
  833.      By default, this region is the entire screen; however, it can be set
  834.      to any rectangular portion of the screen.  (Note that when a viewport
  835.      is in use, coordinates are absolute, not relative to the viewport.)
  836.  
  837.      TGE now supports two viewports simultaneously:  an input viewport and
  838.      an output viewport.  This feature was added primarily so that virtual
  839.      screens (see the VIRTUAL SCREENS section) and the real screen could be
  840.      used simultaneously, though it may have other uses as well.  The
  841.      following functions are used to get and set the current input and
  842.      output viewports:
  843.  
  844.  *** Function:      setInputViewport()
  845.      Syntax:        void setInputViewport(int ulx, int uly, int lrx, int lry);
  846.      Purpose:       Set the defining coordinates of the current input
  847.                     viewport.
  848.      Parameters:    The upper-left corner of the input viewport will be set to
  849.                     ('ulx','uly'), and the lower-right corner to
  850.                     ('lrx','lry').
  851.      Return value:  None.
  852.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  853.      See also:      setOutputViewport(), setViewports(),
  854.                     getInputViewport(), getOutputViewport()
  855.  
  856.  *** Function:      setOutputViewport()
  857.      Syntax:        void setOutputViewport(int ulx, int uly, int lrx, int lry);
  858.      Purpose:       Set the defining coordinates of the current output
  859.                     viewport.
  860.      Parameters:    The upper-left corner of the output viewport will be set
  861.                     to ('ulx','uly'), and the lower-right corner to
  862.                     ('lrx','lry').
  863.      Return value:  None.
  864.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  865.      See also:      setInputViewport(), setViewports(),
  866.                     getOutputViewport(), getInputViewport()
  867.  
  868.  *** Function:      setViewports()
  869.      Syntax:        void setViewports(int ulx, int uly, int lrx, int lry);
  870.      Purpose:       Set the defining coordinates of the current input and
  871.                     output viewports.
  872.      Parameters:    The upper-left corner of the viewports will be set to
  873.                     ('ulx','uly'), and the lower-right corner to
  874.                     ('lrx','lry').
  875.      Return value:  None.
  876.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  877.      See also:      setInputViewport(), setOutputViewport(),
  878.                     getInputViewport(), getOutputViewport()
  879.  
  880.  *** Function:      getInputViewport()
  881.      Syntax:        void getInputViewport(int *ulx, int *uly, int *lrx, int
  882.                     *lry);
  883.      Purpose:       Get the defining coordinates of the current input
  884.                     viewport.
  885.      Parameters:    The upper-left corner of the input viewport will be stored
  886.                     in ('ulx','uly'), and the lower-right corner in
  887.                     ('lrx','lry').
  888.      Return value:  None.
  889.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  890.      See also:      getOutputViewport(), setInputViewport(),
  891.                     setOutputViewport()
  892.  
  893.  *** Function:      getOutputViewport()
  894.      Syntax:        void getOutputViewport(int *ulx, int *uly, int *lrx, int
  895.                     *lry);
  896.      Purpose:       Get the defining coordinates of the current output
  897.                     viewport.
  898.      Parameters:    The upper-left corner of the output viewport will be
  899.                     stored in ('ulx','uly'), and the lower-right corner in
  900.                     ('lrx','lry').
  901.      Return value:  None.
  902.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  903.      See also:      setOutputViewport(), getInputViewport(),
  904.                     getOutputViewport()
  905.  
  906.  
  907.      Note that not all of TGE's functions will clip to within the current
  908.      output viewport.  Some of the time-critical graphics primitives, such
  909.      as putPixel() and line(), do not clip in order to improve execution
  910.      time.  If it is necessary for such functions to have their output
  911.      clipped, the following routines may be used:
  912.  
  913.  *** Function:      clipRect()
  914.      Syntax:        int clipRect(int *x1, int *y1, int *x2, int *y2);
  915.      Purpose:       Clip the given rectangle to within the current output
  916.                     viewport.
  917.      Parameters:    The upper-left and lower-right corners of the rectangle
  918.                     are passed in ('x1','y1') and ('x2','y2').  If clipping
  919.                     is done, these points will be modified.
  920.      Return value:  Returns true if the rectangle lies entirely or
  921.                     partially within the current output viewport, or false
  922.                     if it is entirely outside the current output viewport.
  923.      Remarks:            It does not matter which of the corner coordinates
  924.                     is passed first; they will be swapped if necessary.
  925.                          This function is contained in CLIP.C.
  926.  
  927.  *** Function:      clipLine()
  928.      Syntax:        int clipLine(int *x1, int *y1, int *x2, int *y2);
  929.      Purpose:       Clip the given line to within the current output
  930.                     viewport.
  931.      Parameters:    The endpoints of the line are passed in ('x1','y1') and
  932.                     ('x2','y2').  If clipping is done, these endpoints will
  933.                     be modified.
  934.      Return value:  Returns true if the line lies entirely or partially
  935.                     within the current output viewport, or false if it is
  936.                     entirely outside the current output viewport.
  937.      Remarks:       This function is contained in CLIP.C.
  938.      See also:      None.
  939.  
  940.  *** Function:      clipInputPoint()
  941.      Syntax:        int clipInputPoint(int x, int y);
  942.      Purpose:       Return a flag indicating whether or not the specified
  943.                     coordinates lie within the current input viewport.
  944.      Parameters:    The point ('x','y') is tested.
  945.      Return value:  Returns true if ('x','y') is within the current
  946.                     input viewport, or 0 if it isn't.
  947.      Remarks:       This function is really a macro defined in TGE.H.
  948.      See also:      None.
  949.  
  950.  *** Function:      clipOutputPoint()
  951.      Syntax:        int clipOutputPoint(int x, int y);
  952.      Purpose:       Return a flag indicating whether or not the specified
  953.                     coordinates lie within the current output viewport.
  954.      Parameters:    The point ('x','y') is tested.
  955.      Return value:  Returns true if ('x','y') is within the current
  956.                     output viewport, or 0 if it isn't.
  957.      Remarks:       This function is really a macro defined in TGE.H.
  958.      See also:      None.
  959.  
  960.  *** Function:      pointOnScreen()
  961.      Syntax:        int pointOnScreen(int x, int y);
  962.      Purpose:       Return a flag indicating whether or not the specified
  963.                     coordinates lie on-screen.
  964.      Parameters:    The point ('x','y') is tested.
  965.      Return value:  Returns true if ('x','y') is on-screen, or 0 if it is
  966.                     off-screen.
  967.      Remarks:       This function is really a macro defined in TGE.H.
  968.      See also:      None.
  969.  
  970.  
  971.      Note that since these function names are actually macros, they may
  972.      easily be changed to suit individual preferences by editing TGE.H.
  973.  
  974.  
  975.  
  976. VIRTUAL COORDINATES
  977. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  978.  
  979.      One of the problems associated with device-independence is that
  980.      different display modes have different resolutions.  TGE provides a
  981.      simple way to ease this problem, simply by #including VCOORD.H.  Doing
  982.      so provides access to a simple yet powerful object-oriented virtual
  983.      coordinate system.
  984.  
  985.      For the sake of illustration, assume that you are writing an
  986.      application which ideally will be run in resolutions as high as
  987.      1024x768, but can also be run in 320x200.  You want a way to have
  988.      objects (eg., windows) retain the same sizes and positions on-screen
  989.      in any graphics mode.  TGE's virtual coordinate system makes it easy.
  990.      First, create an instance of the virtual coordinate object (I'll call
  991.      the object virtScreen):
  992.  
  993.           VirtualCoord virtScreen;
  994.  
  995.      Then, virtScreen must be configured; I'll assume that the virtual
  996.      screen is to be 1024x768, and that OUTMAXX and OUTMAXY have been
  997.      initialized by loading a driver.  (Note that these parameters may be
  998.      set during the class instantiation by using a different constructor.)
  999.  
  1000.           virtScreen.virtParams(1023, 767);
  1001.           virtScreen.realParams(OUTMAXX, OUTMAXY);
  1002.  
  1003.      As an example, assume that you want to draw a light gray rectangle
  1004.      with upper-left coordinates (50,50) and lower-right coordinates
  1005.      (600,600) on the virtual screen.  On, say, a 360x480 screen these
  1006.      values will be quite different; to keep the proportions the same,
  1007.      execute a line like the following:
  1008.  
  1009.           drawRect(virtScreen.realX(50), virtScreen.realY(50),
  1010.                    virtScreen.realX(600), virtScreen.realY(600),
  1011.                    colourCloseTo(200,200,200));
  1012.  
  1013.      That's all there is to it!  Keep in mind that there are other
  1014.      applications of the VirtualCoord class, aside from a virtual screen;
  1015.      it can also be useful when dealing with portions of the screen, scaled
  1016.      bitmaps, etc..
  1017.  
  1018.      A complete list of the VirtualCoord member functions follows.
  1019.  
  1020.  
  1021.  *** Function:      VirtualCoord::VirtualCoord()
  1022.      Syntax:        VirtualCoord::VirtualCoord(void);
  1023.      Purpose:       Create an instance of the VirtualCoord class.
  1024.      Parameters:    None.
  1025.      Return value:  None.
  1026.      Remarks:       After an instantiation of a VirtualCoord using this
  1027.                     constructor, ensure that the screen dimensions, both
  1028.                     virtual and real, are initialized using the method
  1029.                     illustrated above.
  1030.      See also:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  1031.                     unsigned, unsigned), VirtualCoord::virtParams(unsigned,
  1032.                     unsigned), VirtualCoord::realParams(unsigned, unsigned)
  1033.  
  1034.  *** Function:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  1035.                     unsigned, unsigned)
  1036.      Syntax:        VirtualCoord::VirtualCoord(unsigned virtMaxX, unsigned
  1037.                     virtMaxY, unsigned realMaxX, unsigned realMaxY);
  1038.      Purpose:       Create an instance of the VirtualCoord class, and
  1039.                     initialize it.
  1040.      Parameters:    The maximum virtual x-coordinate is set to 'virtMaxX',
  1041.                     and the y-coordinate to 'virtMaxY'.  The maximum real
  1042.                     x-coordinate is set to 'realMaxX', and the y-coordinate
  1043.                     to 'realMaxY'.
  1044.      Return value:  None.
  1045.      Remarks:       Be sure that a driver has been loaded before passing
  1046.                     OUTMAXX and OUTMAXY to this constructor.
  1047.      See also:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  1048.                     unsigned, unsigned), VirtualCoord::virtParams(unsigned,
  1049.                     unsigned), VirtualCoord::realParams(unsigned, unsigned)
  1050.  
  1051.  *** Function:      VirtualCoord::virtParams(unsigned, unsigned)
  1052.      Syntax:        void VirtualCoord::virtParams(unsigned virtMaxX,
  1053.                     unsigned virtMaxY);
  1054.      Purpose:       Set the maximum virtual x- and y-coordinates.
  1055.      Parameters:    The maximum virtual x-coordinate is set to 'virtMaxX',
  1056.                     and the maximum y-coordinate to 'virtMaxY'.
  1057.      Return value:  None.
  1058.      Remarks:       None.
  1059.      See also:      VirtualCoord::realParams(unsigned, unsigned),
  1060.                     VirtualCoord::virtParams(unsigned*, unsigned*),
  1061.                     VirtualCoord::realParams(unsigned*, unsigned*)
  1062.  
  1063.  *** Function:      VirtualCoord::realParams(unsigned, unsigned)
  1064.      Syntax:        void VirtualCoord::realParams(unsigned virtMaxX,
  1065.                     unsigned virtMaxY);
  1066.      Purpose:       Set the maximum real x- and y-coordinates.
  1067.      Parameters:    The maximum real x-coordinate is set to 'realMaxX', and
  1068.                     the maximum y-coordinate to 'realMaxY'.
  1069.      Return value:  None.
  1070.      Remarks:       None.
  1071.      See also:      VirtualCoord::virtParams(unsigned, unsigned),
  1072.                     VirtualCoord::realParams(unsigned*, unsigned*),
  1073.                     VirtualCoord::virtParams(unsigned*, unsigned*)
  1074.  
  1075.  *** Function:      VirtualCoord::virtParams(unsigned*, unsigned*)
  1076.      Syntax:        void VirtualCoord::virtParams(unsigned *virtMaxX,
  1077.                     unsigned *virtMaxY);
  1078.      Purpose:       Get the maximum virtual x- and y-coordinates.
  1079.      Parameters:    The maximum virtual x-coordinate is stored in
  1080.                     'virtMaxX', and the maximum y-coordinate in 'virtMaxY'.
  1081.      Return value:  None.
  1082.      Remarks:       None.
  1083.      See also:      VirtualCoord::realParams(unsigned*, unsigned*),
  1084.                     VirtualCoord::virtParams(unsigned, unsigned),
  1085.                     VirtualCoord::realParams(unsigned, unsigned)
  1086.  
  1087.  *** Function:      VirtualCoord::realParams(unsigned*, unsigned*)
  1088.      Syntax:        void VirtualCoord::realParams(unsigned *virtMaxX,
  1089.                     unsigned *virtMaxY);
  1090.      Purpose:       Get the maximum real x- and y-coordinates.
  1091.      Parameters:    The maximum real x-coordinate is stored in 'realMaxX',
  1092.                     and the maximum y-coordinate in 'realMaxY'.
  1093.      Return value:  None.
  1094.      Remarks:       None.
  1095.      See also:      VirtualCoord::virtParams(unsigned*, unsigned*),
  1096.                     VirtualCoord::realParams(unsigned, unsigned),
  1097.                     VirtualCoord::virtParams(unsigned, unsigned)
  1098.  
  1099.  *** Function:      VirtualCoord::realCoords()
  1100.      Syntax:        void VirtualCoord::realCoords(unsigned virtX, unsigned
  1101.                     virtY, unsigned *realX, unsigned *realY);
  1102.      Purpose:       Calculate the real (x,y) coordinates given the virtual
  1103.                     coordinates.
  1104.      Parameters:    The real (x,y) coordinates are returned in
  1105.                     ('realX','realY'), and are calculated based on the
  1106.                     virtual (x,y) coordinates ('virtX','virtY').
  1107.      Return value:  None.
  1108.      Remarks:       None.
  1109.      See also:      VirtualCoord::realX(), VirtualCoord::realY(),
  1110.                     VirtualCoord::virtCoords(), VirtualCoord::virtX(),
  1111.                     VirtualCoord::virtY()
  1112.  
  1113.  *** Function:      VirtualCoord::realX()
  1114.      Syntax:        unsigned VirtualCoord::realX(unsigned virtX);
  1115.      Purpose:       Calculate the real x-coordinate given the virtual x-
  1116.                     coordinate.
  1117.      Parameters:    The real x-coordinate is returned, calculated based on
  1118.                     the virtual x-coordinate 'virtX'.
  1119.      Return value:  Returns the real x-coordinate.
  1120.      Remarks:       None.
  1121.      See also:      VirtualCoord::realY(), VirtualCoord::realCoords(),
  1122.                     VirtualCoord::virtX(), VirtualCoord::virtY(),
  1123.                     VirtualCoord::virtCoords()
  1124.  
  1125.  *** Function:      VirtualCoord::realY()
  1126.      Syntax:        unsigned VirtualCoord::realY(unsigned virtY);
  1127.      Purpose:       Calculate the real y-coordinate given the virtual y-
  1128.                     coordinate.
  1129.      Parameters:    The real y-coordinate is returned, calculated based on
  1130.                     the virtual y-coordinate 'virtY'.
  1131.      Return value:  Returns the real y-coordinate.
  1132.      Remarks:       None.
  1133.      See also:      VirtualCoord::realX(), VirtualCoord::realCoords(),
  1134.                     VirtualCoord::virtY(), VirtualCoord::virtX(),
  1135.                     VirtualCoord::virtCoords()
  1136.  
  1137.  *** Function:      VirtualCoord::virtCoords()
  1138.      Syntax:        void VirtualCoord::virtCoords(unsigned realX, unsigned
  1139.                     realY, unsigned *virtX, unsigned *virtY);
  1140.      Purpose:       Calculate the virtual (x,y) coordinates given the real
  1141.                     coordinates.
  1142.      Parameters:    The virtual (x,y) coordinates are returned in
  1143.                     ('virtX','virtY'), and are calculated based on the real
  1144.                     (x,y) coordinate ('realX','realY').
  1145.      Return value:  None.
  1146.      Remarks:       None.
  1147.      See also:      VirtualCoord::virtX(), VirtualCoord::virtY(),
  1148.                     VirtualCoord::realCoords(), VirtualCoord::realX(),
  1149.                     VirtualCoord::realY()
  1150.  
  1151.  *** Function:      VirtualCoord::virtX()
  1152.      Syntax:        unsigned VirtualCoord::virtX(unsigned realX);
  1153.      Purpose:       Calculate the virtual x-coordinate given the real x-
  1154.                     coordinate.
  1155.      Parameters:    The virtual x-coordinate is returned, calculated based
  1156.                     on the real x-coordinate 'realX'.
  1157.      Return value:  Returns the virtual x-coordinate.
  1158.      Remarks:       None.
  1159.      See also:      VirtualCoord::virtY(), VirtualCoord::virtCoords(),
  1160.                     VirtualCoord::realX(), VirtualCoord::realY(),
  1161.                     VirtualCoord::realCoords()
  1162.  
  1163.  *** Function:      VirtualCoord::virtY()
  1164.      Syntax:        unsigned VirtualCoord::virtY(unsigned realY);
  1165.      Purpose:       Calculate the virtual y-coordinate given the real y-
  1166.                     coordinate.
  1167.      Parameters:    The virtual y-coordinate is returned, calculated based
  1168.                     on the real y-coordinate 'realY'.
  1169.      Return value:  Returns the virtual y-coordinate.
  1170.      Remarks:       None.
  1171.      See also:      VirtualCoord::virtX(), VirtualCoord::virtCoords(),
  1172.                     VirtualCoord::realY(), VirtualCoord::realX(),
  1173.                     VirtualCoord::realCoords()
  1174.  
  1175.  
  1176.  
  1177. VIRTUAL SCREENS
  1178. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1179.  
  1180.      In early releases of TGE, all graphics input and output operations
  1181.      were done on the screen.  Now four different I/O arrangements are
  1182.      available:
  1183.         - Input and output on the real screen.
  1184.         - Input and output on a virtual screen (ie. in memory).
  1185.         - Input from the real screen, and output to a virtual screen.
  1186.         - Input from a virtual screen, and output to the real screen.
  1187.      As well, it is possible to switch between these four I/O modes at any
  1188.      time with one or two simple function calls.
  1189.  
  1190.      Virtual screens are useful for such tasks as building complex images
  1191.      off-screen, then displaying them quickly.  Since a virtual screen has
  1192.      exactly the same format as the images used by getImage() and its
  1193.      associated functions, they can be displayed using a putImage() or
  1194.      putImageInv() call, simply by passing the address of the virtual
  1195.      screen as the address of the image to be displayed.
  1196.  
  1197.  
  1198.      A virtual screen (or any bitmap, for that matter) may be created using
  1199.      the following function:
  1200.  
  1201.  *** Function:      makeVirtScreen()
  1202.      Syntax:        void far *makeVirtScreen(unsigned wide, unsigned deep);
  1203.      Purpose:       Allocate enough RAM to store a virtual screen with the
  1204.                     specified dimensions, then initialize it.
  1205.      Parameters:    A virtual screen with width 'wide' and depth 'deep' (in
  1206.                     pixels) will be created.
  1207.      Return value:  Returns the address of the newly allocated virtual
  1208.                     screen, or NULL if there is not enough memory to create
  1209.                     it.
  1210.      Remarks:            Memory for the virtual screen is alloated from
  1211.                     available conventional memory; don't forget to
  1212.                     de-allocate (using farfree()) the memory occupied by a
  1213.                     virtual screen when the screen is no longer needed.
  1214.                          After it is allocated, a virtual screen will
  1215.                     likely be filled with random pixels.  Clearing it using
  1216.                     clearGraphics() is often a good idea (after graphics
  1217.                     output has been set to the virtual screen).
  1218.      See also:      None.
  1219.      
  1220.  
  1221.      The functions used to establish input and output to and from real and
  1222.      virtual screens are:
  1223.  
  1224.  *** Function:      setGraphicsAddr()
  1225.      Syntax:        void setGraphicsAddr(void far *addr);
  1226.      Purpose:       Set the location upon which graphics input and output
  1227.                     will both be performed.
  1228.      Parameters:    If 'addr' is equal to NULL, input and output will be
  1229.                     performed on the real screen; if 'addr' is non-NULL,
  1230.                     input and output will be performed on the virtual
  1231.                     screen pointed to by 'addr'.
  1232.      Return value:  None.
  1233.      Remarks:       This function sets the currently active input and
  1234.                     output viewports to cover the entirety of the virtual
  1235.                     screen.  INMAXX, INMAXY, OUTMAXX, and OUTMAXY are also
  1236.                     changed appropriately.
  1237.      See also:      setGraphicsInputAddr(), setGraphicsOutputAddr()
  1238.  
  1239.  *** Function:      setGraphicsInputAddr()
  1240.      Syntax:        void setGraphicsInputAddr(void far *addr);
  1241.      Purpose:       Set the location upon which graphics input will be
  1242.                     performed.
  1243.      Parameters:    If 'addr' is equal to NULL, input will be performed on
  1244.                     the real screen; if 'addr' is non-NULL, input will be
  1245.                     performed on the virtual screen pointed to by 'addr'.
  1246.      Return value:  None.
  1247.      Remarks:       This function sets the currently active input viewport
  1248.                     to cover the entirety of the virtual screen.  INMAXX
  1249.                     and INMAXY are also changed appropriately.
  1250.      See also:      setGraphicsOutputAddr(), setGraphicsAddr()
  1251.  
  1252.  *** Function:      setGraphicsOutputAddr()
  1253.      Syntax:        void setGraphicsOutputAddr(void far *addr);
  1254.      Purpose:       Set the location upon which graphics output will be
  1255.                     performed.
  1256.      Parameters:    If 'addr' is equal to NULL, output will be performed on
  1257.                     the real screen; if 'addr' is non-NULL, output will be
  1258.                     performed on the virtual screen pointed to by 'addr'.
  1259.      Return value:  None.
  1260.      Remarks:       This function sets the currently active output viewport
  1261.                     to cover the entirety of the virtual screen.  OUTMAXX
  1262.                     and OUTMAXY are also changed appropriately.
  1263.      See also:      setGraphicsInputAddr(), setGraphicsAddr()
  1264.  
  1265.  *** Function:      getGraphicsInputAddr()
  1266.      Syntax:        void far *getGraphicsInputAddr(void);
  1267.      Purpose:       Get the location upon which graphics input is currently
  1268.                     being performed.
  1269.      Parameters:    None.
  1270.      Return value:  Returns NULL if graphics input is currently being
  1271.                     performed on the physical screen, or the address of the
  1272.                     virtual screen upon which input is being performed
  1273.                     otherwise.
  1274.      Remarks:       None.
  1275.      See also:      getGraphicsOutputAddr()
  1276.  
  1277.  *** Function:      getGraphicsOutputAddr()
  1278.      Syntax:        void far *getGraphicsOutputAddr(void);
  1279.      Purpose:       Get the location upon which graphics output is currently
  1280.                     being performed.
  1281.      Parameters:    None.
  1282.      Return value:  Returns NULL if graphics output is currently being
  1283.                     performed on the physical screen, or the address of the
  1284.                     virtual screen upon which output is being performed
  1285.                     otherwise.
  1286.      Remarks:       None.
  1287.      See also:      getGraphicsInputAddr()
  1288.  
  1289.  
  1290.  
  1291. GRAPHICAL OUTPUT MODES
  1292. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1293.  
  1294.      In early releases of TGE, all graphics output was copied to the
  1295.      screen.  Now output can be copied, ANDed, NOTed, ORed, or XORed, even
  1296.      to virtual screens.  A description of each of these output modes
  1297.      follows:
  1298.         - COPY:  This mode is the one which will likely be used most
  1299.           frequently.  In this mode, any output is copied directly,
  1300.           overwriting anything which was previously there.
  1301.         - AND:  In this mode, each pixel output is ANDed with the pixel
  1302.           already at the same location.
  1303.         - NOT:  In this mode, each pixel output is NOTed before being
  1304.           output.
  1305.         - OR:  In this mode, each pixel output is ORed with the pixel
  1306.           already at the same location.
  1307.         - XOR:  In this mode, each pixel output is XORed with the pixel
  1308.           already at the same location.
  1309.  
  1310.  
  1311.      The following function allows selection of the output mode:
  1312.  
  1313.  *** Function:      setGraphicsOutputMode()
  1314.      Syntax:        void setGraphicsOutputMode(int mode);
  1315.      Purpose:       Select the currently used output mode.
  1316.      Parameters:    The output mode will be set to COPY if 'mode' is
  1317.                     TGE_COPY_PUT, AND if it is TGE_AND_PUT, NOT if it is
  1318.                     TGE_NOT_PUT, OR if it is TGE_OR_PUT, or XOR if it is
  1319.                     TGE_XOR_PUT.  These macros are defined in TGE.H.
  1320.      Return value:  None.
  1321.      Remarks:       These output modes affect output to physical and
  1322.                     virtual screens.
  1323.      See also:      None.
  1324.  
  1325.  
  1326.  
  1327. USING FONTS
  1328. ▀▀▀▀▀▀▀▀▀▀▀
  1329.  
  1330.      TGE supports two types of loadable fonts:  fixed-size monochrome fonts
  1331.      (implemented with the FixedFont class), and variable-size 256-colour
  1332.      fonts (implemented with the VariableFont class).  Both high- and
  1333.      low-ASCII characters are supported.  As well, multiple fonts may be
  1334.      resident in memory simultaneously.
  1335.  
  1336.      For variable-size 256-colour fonts:
  1337.      ──────────────────────────────────
  1338.           In order to use a variable-size 256-colour font, an instance of
  1339.           the VariableFont class is necessary.  Font initialization will
  1340.           look something like this:
  1341.  
  1342.                VariableFont systemFont;
  1343.                char systemFontName[] = "BIGTEXT";
  1344.                     .
  1345.                     .
  1346.                     .
  1347.                if (!systemFont.load(systemFontName))
  1348.                {
  1349.                  printf("Error loading %s; aborting.\n\n", systemFontName);
  1350.                  exit(EXIT_FAILURE);
  1351.                }
  1352.  
  1353.           Once a font has been loaded, it may be manipulated via its
  1354.           VariableFont class instance.  The class destructor automatically
  1355.           removes the font from memory.
  1356.  
  1357.           A complete list of the VariableFont member functions follows.
  1358.  
  1359.  
  1360.       *** Function:      VariableFont::load()
  1361.           Syntax:        int VariableFont::load(char *filename);
  1362.           Purpose:       Load a font from disk.
  1363.           Parameters:    The font file 'filename' will be loaded.
  1364.           Return value:  Returns 0 on error.
  1365.           Remarks:       None.
  1366.           See also:      None.
  1367.  
  1368.       *** Function:      VariableFont::put()
  1369.           Syntax:        void VariableFont::put(int x, int y, char
  1370.                          ch);
  1371.           Purpose:       Write a character on screen.
  1372.           Parameters:    The character 'ch' will be displayed with its
  1373.                          upper-left corner at ('x','y').
  1374.           Return value:  None.
  1375.           Remarks:       None.
  1376.           See also:      VariableFont::put(int, int, char*)
  1377.  
  1378.       *** Function:      VariableFont::put()
  1379.           Syntax:        void VariableFont::put(int x, int y, char
  1380.                          *string);
  1381.           Purpose:       Write a string on screen.
  1382.           Parameters:    The string 'string' will be displayed with its
  1383.                          upper-left corner at ('x','y').
  1384.           Return value:  None.
  1385.           Remarks:       None.
  1386.           See also:      VariableFont::put(int, int, char)
  1387.  
  1388.       *** Function:      VariableFont::width()
  1389.           Syntax:        unsigned VariableFont::width(char *string);
  1390.           Purpose:       Determine the width of a string.
  1391.           Parameters:    The width of the string 'string' will be
  1392.                          determined.
  1393.           Return value:  The width of the string, in pixels, will be
  1394.                          returned.
  1395.           Remarks:       None.
  1396.           See also:      VariableFont::width(char),
  1397.                          VariableFont::height(char*),
  1398.                          VariableFont::height(char)
  1399.  
  1400.       *** Function:      VariableFont::height()
  1401.           Syntax:        unsigned VariableFont::height(char *string);
  1402.           Purpose:       Determine the height of a string.
  1403.           Parameters:    The height of the string 'string' will be
  1404.                          determined.
  1405.           Return value:  The height of the string, in pixels, will be
  1406.                          returned.
  1407.           Remarks:       None.
  1408.           See also:      VariableFont::height(char),
  1409.                          VariableFont::width(char*),
  1410.                          VariableFont::width(char),
  1411.                          VariableFont::maxHeight()
  1412.  
  1413.       *** Function:      VariableFont::width()
  1414.           Syntax:        unsigned short VariableFont::width(char ch);
  1415.           Purpose:       Determine the width of a character.
  1416.           Parameters:    The width of the character 'ch' will be
  1417.                          determined.
  1418.           Return value:  The width of the string, in pixels, will be
  1419.                          returned.
  1420.           Remarks:       None.
  1421.           See also:      VariableFont::width(char*),
  1422.                          VariableFont::height(char),
  1423.                          VariableFont::width(char*)
  1424.  
  1425.       *** Function:      VariableFont::height()
  1426.           Syntax:        unsigned short VariableFont::height(char ch);
  1427.           Purpose:       Determine the height of a character.
  1428.           Parameters:    The height of the character 'ch' will be
  1429.                          determined.
  1430.           Return value:  The height of the string, in pixels, will be
  1431.                          returned.
  1432.           Remarks:       None.
  1433.           See also:      VariableFont::height(char*),
  1434.                          VariableFont::width(char),
  1435.                          VariableFont::height(char*),
  1436.                          VariableFont::maxHeight()
  1437.  
  1438.       *** Function:      VariableFont::maxHeight()
  1439.           Syntax:        unsigned short VariableFont::maxHeight(void);
  1440.           Purpose:       Determine the height of the tallest character.
  1441.           Parameters:    None.
  1442.           Return value:  The height of the tallest character, in pixels,
  1443.                          will be returned.
  1444.           Remarks:       None.
  1445.           See also:      VariableFont::height(char*),
  1446.                          VariableFont::height(char)
  1447.  
  1448.       *** Function:      VariableFont::matchColours()
  1449.           Syntax:        void VariableFont::matchColours(void);
  1450.           Purpose:       Match the font colours as closely as possible to
  1451.                          the currently selected font palette.
  1452.           Parameters:    None.
  1453.           Return value:  None.
  1454.           Remarks:       This function is really only useful after the
  1455.                          colour palette has been changed.
  1456.           See also:      VariableFont::palette(void*)
  1457.  
  1458.       *** Function:      VariableFont::palette(void*)
  1459.           Syntax:        void VariableFont::palette(void *palette);
  1460.           Purpose:       Change the currently active font palette.
  1461.           Parameters:    The currently active font palette will be set to
  1462.                          the palette at 'palette'.
  1463.           Return value:  None.
  1464.           Remarks:       VariableFont::matchColours() is autmatically
  1465.                          called by this function.
  1466.           See also:      VariableFont::palette(void),
  1467.                          VariableFont::palette(unsigned char, unsigned
  1468.                          char, unsigned char, unsigned char),
  1469.                          VariableFont::matchColours()
  1470.  
  1471.       *** Function:      VariableFont::palette(void)
  1472.           Syntax:        void *VariableFont::palette(void);
  1473.           Purpose:       Get the address of the currently active font
  1474.                          palette.
  1475.           Parameters:    None.
  1476.           Return value:  Returns the address of the font palette.
  1477.           Remarks:       If a change is made to this data directly, you
  1478.                          must call VariableFont::palette(void*) if the
  1479.                          changes are to take effect.
  1480.           See also:      VariableFont::palette(void),
  1481.                          VariableFont::palette(unsigned char, unsigned
  1482.                          char*, unsigned char*, unsigned char*)
  1483.  
  1484.       *** Function:      VariableFont::palette(unsigned char, unsigned
  1485.                          char, unsigned char, unsigned char)
  1486.           Syntax:        void VariableFont::palette(unsigned char palReg,
  1487.                          unsigned char red, unsigned char green, unsigned
  1488.                          char blue);
  1489.           Purpose:       Change one of the colours of the font palette.
  1490.           Parameters:    Colour number 'palReg' of the font palette will be
  1491.                          set to match the values passed in 'red', 'green',
  1492.                          and 'blue'.
  1493.           Return value:  None.
  1494.           Remarks:       The change will take effect immediately; there is
  1495.                          no need to explicitly update the palette.
  1496.           See also:      VariableFont::palette(void*)
  1497.  
  1498.       *** Function:      VariableFont::palette(unsigned char, unsigned
  1499.                          char*, unsigned char*, unsigned char*)
  1500.           Syntax:        void VariableFont::palette(unsigned char palReg,
  1501.                          unsigned char *red, unsigned char *green, unsigned
  1502.                          char *blue);
  1503.           Purpose:       Determine the contents of one of the colours of
  1504.                          the font palette.
  1505.           Parameters:    Colour number 'palReg' of the font palette will be
  1506.                          passed to the caller in 'red', 'green', and
  1507.                          'blue'.
  1508.           Return value:  None.  On return, however, the colour's components
  1509.                          will be present at the 'red', 'green', and 'blue'
  1510.                          buffers.
  1511.           Remarks:       None.
  1512.           See also:      VariableFont::palette(void)
  1513.  
  1514.       *** Function:      VariableFont::spacing()
  1515.           Syntax:        void VariableFont::spacing(unsigned numPixels);
  1516.           Purpose:       Change the spacing between characters.
  1517.           Parameters:    After calling this function, the number of pixels
  1518.                          left between characters output with
  1519.                          VariableFont::put(char*) will be set to
  1520.                          'numPixels'.
  1521.           Return value:  None.
  1522.           Remarks:       The spacing defaults to one pixel between each
  1523.                          character.
  1524.           See also:      VariableFont::spacing(void)
  1525.  
  1526.       *** Function:      VariableFont::spacing()
  1527.           Syntax:        unsigned VariableFont::spacing(void);
  1528.           Purpose:       Return the spacing between characters.
  1529.           Parameters:    None.
  1530.           Return value:  Returns the number of pixels used to space two
  1531.                          adjacent characters.
  1532.           Remarks:       The spacing defaults to one pixel between each
  1533.                          character.
  1534.           See also:      VariableFont::spacing(unsigned)
  1535.  
  1536.  
  1537.  
  1538.      For fixed-size monochrome fonts:
  1539.      ───────────────────────────────
  1540.           In order to use a fixed-size monochrome font, an instance of the
  1541.           FixedFont class is necessary.  Assuming instantiation of a
  1542.           FixedFont pointer, font initialization will look something like
  1543.           this:
  1544.  
  1545.                FixedFont fixedFont;
  1546.                char fixedFontName[] = "8X16";
  1547.                          .
  1548.                          .
  1549.                          .
  1550.                if (!fixedFont.load(fixedFontName))
  1551.                {
  1552.                  printf("Error loading %s; aborting.\n\n", fixedFontName);
  1553.                  exit(EXIT_FAILURE);
  1554.                }
  1555.  
  1556.           Once a font has been loaded, it may be manipulated via its
  1557.           FixedFont class instance.  The class destructor automatically
  1558.           removes the font from memory.
  1559.  
  1560.           A complete list of the FixedFont member functions follows.
  1561.  
  1562.       *** Function:      FixedFont::FixedFont()
  1563.           Syntax:        FixedFont::FixedFont(unsigned char fg=1, unsigned
  1564.                          char bg=0);
  1565.           Purpose:       Initiate a FixedFont class for use with a font
  1566.                          which will be loaded later.
  1567.           Parameters:    'fg' (which defaults to 1) is the colour to be
  1568.                          used as the foreground colour.  'bg' (which
  1569.                          defaults to 0) is the colour to be used as the
  1570.                          background colour.
  1571.           Return value:  None.
  1572.           Remarks:       None.
  1573.           See also:      None.
  1574.  
  1575.       *** Function:      FixedFont::load()
  1576.           Syntax:        int FixedFont::load(char *filename);
  1577.           Purpose:       Load a font and prepare it for use.
  1578.           Parameters:    The font file 'filename' loaded.
  1579.           Return value:  Returns 0 on error.
  1580.           Remarks:       None.
  1581.           See also:      None.
  1582.  
  1583.       *** Function:      FixedFont::width(char*)
  1584.           Syntax:        unsigned FixedFont::width(char *str);
  1585.           Purpose:       Return the width, in pixels, of a string.
  1586.           Parameters:    The string 'str' is analyzed.
  1587.           Return value:  Returns the width of 'str', in pixels.
  1588.           Remarks:       None.
  1589.           See also:      FixedFont::width(char), FixedFont::height(char*),
  1590.                          FixedFont::height(char), FixedFont::maxWidth(),
  1591.                          FixedFont::maxHeight()
  1592.  
  1593.       *** Function:      FixedFont::width(char)
  1594.           Syntax:        unsigned FixedFont::width(char ch);
  1595.           Purpose:       Return the width, in pixels, of a single
  1596.                          character.
  1597.           Parameters:    The character 'ch' is analyzed.
  1598.           Return value:  Returns the width of 'ch', in pixels.
  1599.           Remarks:       None.
  1600.           See also:      FixedFont::width(char*), FixedFont::height(char),
  1601.                          FixedFont::height(char*), FixedFont::maxWidth(),
  1602.                          FixedFont::maxHeight()
  1603.  
  1604.       *** Function:      FixedFont::maxWidth()
  1605.           Syntax:        unsigned maxWidth(void);
  1606.           Purpose:       Return the width of the widest character.
  1607.           Parameters:    None.
  1608.           Return value:  Returns the width of the widest character.
  1609.           Remarks:       None.
  1610.           See also:      FixedFont::maxHeight(void),
  1611.                          FixedFont::width(char*), FixedFont::width(char),
  1612.                          FixedFont::height(char*), FixedFont::height(char)
  1613.  
  1614.       *** Function:      FixedFont::height(char*)
  1615.           Syntax:        unsigned FixedFont::height(char *str);
  1616.           Purpose:       Return the height, in pixels, of a string.
  1617.           Parameters:    The string 'str' is analyzed.
  1618.           Return value:  Returns the depth of 'str', in pixels.
  1619.           Remarks:       None.
  1620.           See also:      FixedFont::height(char), FixedFont::width(char*),
  1621.                          FixedFont::height(char), FixedFont::maxHeight(),
  1622.                          FixedFont::maxWidth()
  1623.  
  1624.       *** Function:      FixedFont::height(char)
  1625.           Syntax:        unsigned FixedFont::height(char ch);
  1626.           Purpose:       Return the height, in pixels, of a single
  1627.                          character.
  1628.           Parameters:    The character 'ch' is analyzed.
  1629.           Return value:  Returns the height of 'ch', in pixels.
  1630.           Remarks:       None.
  1631.           See also:      FixedFont::height(char*), FixedFont::width(char),
  1632.                          FixedFont::width(char*), FixedFont::maxWidth(),
  1633.                          FixedFont::maxHeight()
  1634.  
  1635.       *** Function:      FixedFont::maxHeight()
  1636.           Syntax:        unsigned maxHeight(void);
  1637.           Purpose:       Return the height of the tallest character.
  1638.           Parameters:    None.
  1639.           Return value:  Returns the height of the tallest character.
  1640.           Remarks:       None.
  1641.           See also:      FixedFont::maxWidth(void),
  1642.                          FixedFont::height(char*), FixedFont::height(char),
  1643.                          FixedFont::width(char*), FixedFont::width(char)
  1644.  
  1645.       *** Function:      FixedFont::put(int, int, char*)
  1646.           Syntax:        void FixedFont::put(int x, int y, char *str);
  1647.           Purpose:       Write a string to the screen.
  1648.           Parameters:    The string 'str' will be written starting at
  1649.                          ('x','y').
  1650.           Return value:  None.
  1651.           Remarks:       The coordinate passed to this function specifies
  1652.                          the upper-left coordinate of the string.
  1653.           See also:      FixedFont::put(char);
  1654.  
  1655.       *** Function:      FixedFont::put(int, int, char)
  1656.           Syntax:        void FixedFont::put(int x, int y, char ch);
  1657.           Purpose:       Write a single character to the screen.
  1658.           Parameters:    The character 'ch' will be written at
  1659.                          ('x','y').
  1660.           Return value:  None.
  1661.           Remarks:       The coordinate passed to this function specifies
  1662.                          the upper-left coordinate of the character.
  1663.           See also:      FixedFont::put(char*);
  1664.  
  1665.       *** Function:      FixedFont::foreground(unsigned)
  1666.           Syntax:        void FixedFont::foreground(unsigned colour);
  1667.           Purpose:       Set the current foreground colour.
  1668.           Parameters:    The foreground colour will be set to 'colour'.
  1669.           Return value:  None.
  1670.           Remarks:       None.
  1671.           See also:      FixedFont::background(unsigned),
  1672.                          FixedFont::foreground(void),
  1673.                          FixedFont::background(void)
  1674.  
  1675.       *** Function:      FixedFont::foreground(void)
  1676.           Syntax:        unsigned FixedFont::foreground(void);
  1677.           Purpose:       Return the current foreground colour.
  1678.           Parameters:    None.
  1679.           Return value:  Returns the current foreground colour.
  1680.           Remarks:       None.
  1681.           See also:      FixedFont::background(void),
  1682.                          FixedFont::foreground(unsigned),
  1683.                          FixedFont::foreground(unsigned)
  1684.  
  1685.       *** Function:      FixedFont::background(unsigned)
  1686.           Syntax:        void FixedFont::background(unsigned colour);
  1687.           Purpose:       Set the current background colour.
  1688.           Parameters:    The background colour will be set to 'colour'.
  1689.           Return value:  None.
  1690.           Remarks:       None.
  1691.           See also:      FixedFont::foreground(unsigned),
  1692.                          FixedFont::background(void),
  1693.                          FixedFont::foreground(void)
  1694.  
  1695.       *** Function:      FixedFont::background(void)
  1696.           Syntax:        unsigned FixedFont::background(void);
  1697.           Purpose:       Return the current background colour.
  1698.           Parameters:    None.
  1699.           Return value:  Returns the current background colour.
  1700.           Remarks:       None.
  1701.           See also:      FixedFont::foreground(void),
  1702.                          FixedFont::background(unsigned),
  1703.                          FixedFont::foreground(unsigned)
  1704.  
  1705.  
  1706.      Note that, at present, TGE's fonts are designed for use in 256-colour
  1707.      modes only.
  1708.  
  1709.  
  1710.  
  1711. BITMAP MANIPULATION
  1712. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1713.  
  1714.      Bitmaps can get boring when all you can do is display them.  TGE can
  1715.      scale bitmaps to different sizes, using the following function:
  1716.  
  1717.  *** Function:      scaleBitmap()
  1718.      Syntax:        void far *scaleBitmap(void *srcImage, unsigned newWide,
  1719.                     unsigned newDeep, void *destImage)
  1720.      Purpose:       Scale the given bitmap to the specified size.
  1721.      Parameters:    The image in 'srcImage' will be scaled to 'newWide'
  1722.                     pixels wide and 'newDeep' pixels deep.  The resulting
  1723.                     scaled image will be placed in 'destImage' if
  1724.                     'destImage' is non-NULL, or in a newly allocated block
  1725.                     of memory if 'destImage' is NULL.
  1726.      Return value:  Returns the address of the scaled image on success, or
  1727.                     NULL on error.  Note that NULL will never be returned
  1728.                     if 'destImage' is non-NULL.
  1729.      Remarks:       Results are undefined if either 'newWide' or 'newDeep'
  1730.                     is equal to zero.
  1731.      See also:      None.
  1732.  
  1733.  
  1734.      TGE also provides routines for determining an image's dimensions given
  1735.      its address:
  1736.  
  1737.  *** Function:      imageWidth
  1738.      Syntax:        unsigned imageWidth(void *image);
  1739.      Purpose:       Determine an image's width.
  1740.      Parameters:    This routine will determine the width of 'image'.
  1741.      Return value:  Returns the width, in pixels, of 'image'.
  1742.      Remarks:       This routine is implemented as a macro in TGE.H.
  1743.      See also:      imageHeight
  1744.  
  1745.  *** Function:      imageHeight
  1746.      Syntax:        unsigned imageHeight(void *image);
  1747.      Purpose:       Determine an image's height.
  1748.      Parameters:    This routine will determine the height of 'image'.
  1749.      Return value:  Returns the height, in pixels, of 'image'.
  1750.      Remarks:       This routine is implemented as a macro in TGE.H.
  1751.      See also:      imageWidth
  1752.  
  1753.  
  1754.  
  1755. PALETTE MANIPULATION
  1756. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1757.  
  1758.      TGE provides some palette manipulation routines, described below:
  1759.  
  1760.  
  1761.  *** Function:      fadePalette
  1762.      Syntax:        int fadePalette(unsigned step, void *inPal, void
  1763.                     *outPal, void *targetPal);
  1764.      Purpose:       Fade one palette into another.
  1765.      Parameters:    The palette at 'inPal' will be faded closer to the
  1766.                     palette at 'targetPal'.  The resulting palette will be
  1767.                     stored at 'outPal'.  Each of the colour components
  1768.                     which compose a palette colour will be incremented or
  1769.                     decremented by no more than the value in 'step'; thus,
  1770.                     higher 'step' values produce more rapid fading.
  1771.      Return value:  Returns 0 if fading is complete, or 1 if it isn't.
  1772.      Remarks:       Note that this function does not always complete the
  1773.                     fading with one call.  Code like this could be used:
  1774.                          while (fadePalette(1, in, out, target))
  1775.                          {
  1776.                            delay(10);
  1777.                            setBlockPalette(0, 255, out);
  1778.                            swap(in, out);
  1779.                            doSomeOtherProcessing();
  1780.                          }
  1781.      See also:      None.
  1782.  
  1783.  *** Function:      greyPalette
  1784.      Syntax:        void greyPalette(void *inPal, void *outPal);
  1785.      Purpose:       Produce a greyscale version of a palette.
  1786.      Parameters:    A greyscale version of the palette at 'inPal' will be
  1787.                     calculated, and stored at 'outPal'.
  1788.      Return value:  None, but the calculated greyscale palette will be at
  1789.                     'outPal' on return.
  1790.      Remarks:       Images designed with the input palette in mind will
  1791.                     look the same under the output greyscale palette,
  1792.                     except that they will be composed entirely of greys,
  1793.                     black, and white.
  1794.      See also:      None.
  1795.  
  1796.  *** Function:      rotatePalette
  1797.      Syntax:        void rotatePalette(int howMuch, void *inPal, void
  1798.                     *outPal)
  1799.      Purpose:       Rotate a palette.
  1800.      Parameters:    The palette at 'inPal' will be rotated by the value
  1801.                     'howMuch', and the resulting palette will be placed at
  1802.                     'outPal'.  'howMuch' can be negative or positive,
  1803.                     depending on which direction rotation will be
  1804.                     performed; for instance, a 'howMuch' value of 1 would
  1805.                     cause the value of colour 0 to move to colour 1, while
  1806.                     a 'howMuch' value of -1 would have the opposite effect.
  1807.      Return value:  None, but the rotated palette will be at 'outPal' on
  1808.                     return.
  1809.      Remarks:       This function will still operate correctly with
  1810.                     'howMuch' values which are greater than 255 or less
  1811.                     than -255.
  1812.      See also:      None.
  1813.  
  1814.  *** Function:      promotePalette
  1815.      Syntax:        void promotePalette(void *pal);
  1816.      Purpose:       Promote a 6-bit palette to 8-bit.
  1817.      Parameters:    The palette at 'pal' will be promoted.
  1818.      Return value:  None, but the promoted palette will be at 'pal' on
  1819.                     return.
  1820.      Remarks:       Some palettes are saved in 6-bit format, which uses
  1821.                     colour component values of 0..63; other programs, TGE
  1822.                     among them, use 8-bit format, which uses colour
  1823.                     component values of 0..255.  This function makes it
  1824.                     easy to use 6-bit palettes with TGE.
  1825.      See also:      demotePalette().
  1826.  
  1827.  *** Function:      demotePalette
  1828.      Syntax:        void demotePalette(void *pal);
  1829.      Purpose:       Demote an 8-bit palette to 6-bit.
  1830.      Parameters:    The palette at 'pal' will be demoted.
  1831.      Return value:  None, but the demoted palette will be at 'pal' on
  1832.                     return.
  1833.      Remarks:       Some palettes are saved in 6-bit format, which uses
  1834.                     colour component values of 0..63; other programs, TGE
  1835.                     among them, use 8-bit format, which uses colour
  1836.                     component values of 0..255.  This function makes it
  1837.                     easy to use 6-bit palettes with TGE.
  1838.      See also:      promotePalette().
  1839.  
  1840.  
  1841.  
  1842. USING THE MOUSE
  1843. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1844.  
  1845.      TGE now provides support for interrupt-driven, definable mouse
  1846.      pointers.  In order to make use of this feature, some simple steps
  1847.      must be taken.
  1848.  
  1849.      The new mouse handler is designed to work in tandem with TGE's
  1850.      graphical functions.  Programs using the new mouse handler must first
  1851.      have successfully initialized graphics mode using TGE.  Both TGE.H and
  1852.      TGEMOUSE.H must be #included into a program using the mouse services.
  1853.  
  1854.      The mouse handler has to be initialized.  To do so, one function call
  1855.      is required:
  1856.  
  1857.           initNewMouse();
  1858.  
  1859.      For more information on initNewMouse(), refer to the mouse functions
  1860.      reference section.
  1861.  
  1862.      Next, the mouse driver must be informed of the screen dimensions, like
  1863.      this:
  1864.  
  1865.           setHorizLimitsMouse(0, OUTMAXX);
  1866.           setVertLimitsMouse(0, OUTMAXY);
  1867.  
  1868.      If desired, the pointer may then be positioned.  To center it on the
  1869.      screen, do this:
  1870.  
  1871.           setPosMouse(OUTMAXX/2, OUTMAXY/2);
  1872.  
  1873.      A pointer shape must then be selected.  TGE, as shipped, includes two
  1874.      arrow pointers and two target pointers; the file MOUSEPTR.C may easily
  1875.      be modified to allow more.  To select, for instance, the big arrow
  1876.      pointer, do this:
  1877.  
  1878.           setupMousePointer(BIG_ARROW_POINTER);
  1879.  
  1880.      The macro BIG_ARROW_POINTER is defined in TGEMOUSE.H; it expands to a
  1881.      number which is used by MOUSEPTR.C to identify which bitmap to use.
  1882.      Note that if exceptionally large (ie. larger than 512 bytes) pointers
  1883.      are used, a change must be made in NEWMOUSE.ASM; see that file for
  1884.      details.  If you would like to directly set a particular bitmap as the
  1885.      mouse pointer, you may use setPointerMouse(), described in the next
  1886.      section.
  1887.  
  1888.      Once things have been initialized, the use of the new mouse handler
  1889.      over the standard mouse driver can essentially be ignored; mouse
  1890.      driver services are obtained in exactly the same way.  The mouse
  1891.      interface functions are prototyped in TGEMOUSE.H, also using the macro
  1892.      method which allows function names to be changed simply by editing
  1893.      TGEMOUSE.H.
  1894.  
  1895.      Before exiting the program, the function deInitNewMouse() _must_ be
  1896.      called.  It is usually a very good idea to place deInitNewMouse() in
  1897.      the atexit() queue immediately after calling initNewMouse().
  1898.  
  1899.      Note that, since the pointer is drawn using TGE's putImageInv()
  1900.      function, the pointer will only appear when it is within the current
  1901.      viewport.
  1902.  
  1903.  
  1904.  
  1905. TGE'S MOUSE FUNCTION SET
  1906. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1907.  
  1908.  *** Function:      initNewMouse()
  1909.      Syntax:        void initNewMouse(void);
  1910.      Purpose:       Initializes the new mouse handler.
  1911.      Parameters:    The new mouse handler will be configured for use with
  1912.                     TGE.
  1913.      Return value:  None.
  1914.      Remarks:            A graphics driver must have been loaded prior to a
  1915.                     call to initNewMouse().
  1916.                          The new mouse handler requires that a Microsoft or
  1917.                     compatible mouse driver already be resident.  It
  1918.                     assumes that a mouse driver's presence will have been
  1919.                     tested beforehand.
  1920.                          initNewMouse() is really a simple macro; refer to
  1921.                     TGEMOUSE.H for the expansion of initNewMouse(void);
  1922.      See also:      deInitNewMouse(), enableNewMouse(), disableNewMouse()
  1923.  
  1924.  *** Function:      deInitNewMouse()
  1925.      Syntax:        void deInitNewMouse(void);
  1926.      Purpose:       Deactivate the new mouse handler, and leave all the
  1927.                     work up to the old driver.
  1928.      Parameters:    None.
  1929.      Return value:  None.
  1930.      Remarks:       This function must be called prior to program exit if
  1931.                     initNewMouse() had previously been called.
  1932.      See also:      initNewMouse(), enableNewMouse(), disableNewMouse()
  1933.  
  1934.  *** Function:      enableNewMouse()
  1935.      Syntax:        void enableNewMouse(void);
  1936.      Purpose:       Reactivate the new mouse handler following a call to
  1937.                     disableNewMouse().
  1938.      Parameters:    None.
  1939.      Return value:  None.
  1940.      Remarks:       None.
  1941.      See also:      disableNewMouse(), initNewMouse(), deInitNewMouse()
  1942.  
  1943.  *** Function:      disableNewMouse()
  1944.      Syntax:        void disableNewMouse(void);
  1945.      Purpose:       Temporarily deactivate the new mouse handler, to be
  1946.                     reactivated later by a call to enableNewMouse().
  1947.      Parameters:    None.
  1948.      Return value:  None.
  1949.      Remarks:       Following a call to this function, the new mouse
  1950.                     handler will cease trapping mouse driver interrupts and
  1951.                     moving the pointer.
  1952.      See also:      enableNewMouse(), initNewMouse(), deInitNewMouse()
  1953.  
  1954.  *** Function:      resetMouse()
  1955.      Syntax:        int resetMouse(void);
  1956.      Purpose:       Reset the mouse driver and hardware.
  1957.      Parameters:    None.
  1958.      Return value:  1 if mouse driver available, 0 otherwise.
  1959.      Remarks:       Following a call to this function, the mouse pointer is
  1960.                     hidden and positioned at the center of the screen.
  1961.      See also:      softResetMouse(), initNewMouse()
  1962.  
  1963.  *** Function:      getButtonsMouse()
  1964.      Syntax:        int getButtonsMouse(void);
  1965.      Purpose:       Return the number of buttons on the mouse.
  1966.      Parameters:    None.
  1967.      Return value:  Returns the number of buttons on the mouse.
  1968.      Remarks:       This function calls resetMouse(), and so the mouse
  1969.                     driver and hardware are re-initialized.
  1970.      See also:      resetMouse()
  1971.  
  1972.  *** Function:      showMouse()
  1973.      Syntax:        void showMouse(void);
  1974.      Purpose:       Show the mouse pointer.
  1975.      Parameters:    None.
  1976.      Return value:  None.
  1977.      Remarks:       Calls to showMouse() and hideMouse() are cumulative;
  1978.                     ie., if showMouse() is called twice, hideMouse() must
  1979.                     be called twice to hide the pointer again.
  1980.      See also:      hideMouse()
  1981.  
  1982.  *** Function:      hideMouse()
  1983.      Syntax:        void hideMouse(void);
  1984.      Purpose:       Hide the mouse pointer.
  1985.      Parameters:    None.
  1986.      Return value:  None.
  1987.      Remarks:       Calls to showMouse() and hideMouse() are cumulative;
  1988.                     ie., if showMouse() is called twice, hideMouse() must
  1989.                     be called twice to hide the pointer again.
  1990.      See also:      showMouse()
  1991.  
  1992.  *** Function:      getPosMouse()
  1993.      Syntax:        void getPosMouse(int far *x, int far *y);
  1994.      Purpose:       Get the current pointer coordinates.
  1995.      Parameters:    The current pointer x- and y-coordinates will be stored
  1996.                     in 'x' and 'y', respectively.
  1997.      Return value:  None.
  1998.      Remarks:       None.
  1999.      See also:      setPosMouse()
  2000.  
  2001.  *** Function:      setPosMouse()
  2002.      Syntax:        void setPosMouse(unsigned x, unsigned y);
  2003.      Purpose:       Set the current pointer coordinates.
  2004.      Parameters:    The pointer will be positioned at ('x','y').
  2005.      Return value:  None.
  2006.      Remarks:       None.
  2007.      See also:      getPosMouse()
  2008.  
  2009.  *** Function:      buttonMouse()
  2010.      Syntax:        int buttonMouse(void);
  2011.      Purpose:       Return whether or not any of the mouse buttons is down.
  2012.      Parameters:    None.
  2013.      Return value:  Returns true if at least one button is down, or zero if
  2014.                     none of them is down.
  2015.      Remarks:       None.
  2016.      See also:      leftButtonMouse(), rightButtonMouse(),
  2017.                     centerButtonMouse(), waitReleaseMouse()
  2018.  
  2019.  *** Function:      leftButtonMouse()
  2020.      Syntax:        int leftButtonMouse(void);
  2021.      Purpose:       Return the status of the left mouse button.
  2022.      Parameters:    None.
  2023.      Return value:  Returns true if the button is down, or zero if it is
  2024.                     up.
  2025.      Remarks:       None.
  2026.      See also:      buttonMouse(), rightButtonMouse(), centerButtonMouse(),
  2027.                     waitReleaseMouse()
  2028.  
  2029.  *** Function:      rightButtonMouse()
  2030.      Syntax:        int rightButtonMouse(void);
  2031.      Purpose:       Return the status of the right mouse button.
  2032.      Parameters:    None.
  2033.      Return value:  Returns true if the button is down, or zero if it is
  2034.                     up.
  2035.      Remarks:       None.
  2036.      See also:      buttonMouse(), leftButtonMouse(), centerButtonMouse(),
  2037.                     waitReleaseMouse()
  2038.  
  2039.  *** Function:      centerButtonMouse()
  2040.      Syntax:        int centerButtonMouse(void);
  2041.      Purpose:       Return the status of the center mouse button.
  2042.      Parameters:    None.
  2043.      Return value:  Returns true if the button is down, or zero if it is
  2044.                     up.
  2045.      Remarks:       None.
  2046.      See also:      buttonMouse(), leftButtonMouse(), rightButtonMouse(),
  2047.                     waitReleaseMouse()
  2048.  
  2049.  *** Function:      buttonPressMouse()
  2050.      Syntax:        unsigned buttonPressMouse(unsigned button, int far *x,
  2051.                     int far *y);
  2052.      Purpose:       Return the number of times the specified button has
  2053.                     been pressed since the last call to this function (with
  2054.                     the same button parameter), and store the coordinates
  2055.                     of the last press.
  2056.      Parameters:    The button 'button' is checked, and may be any of
  2057.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  2058.                     defined in TGEMOUSE.H.  The position of the last press
  2059.                     will be stored in ('x','y').
  2060.      Return value:  Returns the number of times the specified button has
  2061.                     been pressed since the last call to this function (with
  2062.                     the same button parameter).
  2063.      Remarks:       None.
  2064.      See also:      buttonReleaseMouse()
  2065.  
  2066.  *** Function:      buttonReleaseMouse()
  2067.      Syntax:        unsigned buttonReleaseMouse(unsigned button, int far
  2068.                     *x, int far *y);
  2069.      Purpose:       Return the number of times the specified button has
  2070.                     been released since the last call to this function
  2071.                     (with the same button parameter), and store the
  2072.                     coordinates of the last press.
  2073.      Parameters:    The button 'button' is checked, and may be any of
  2074.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  2075.                     defined in TGEMOUSE.H.  The position of the last
  2076.                     release will be stored in ('x','y').
  2077.      Return value:  Returns the number of times the specified button has
  2078.                     been released since the last call to this function
  2079.                     (with the same button parameter).
  2080.      Remarks:       None.
  2081.      See also:      buttonPressMouse()
  2082.  
  2083.  *** Function:      waitReleaseMouse()
  2084.      Syntax:        void waitReleaseMouse(int button);
  2085.      Purpose:       If the specified button is not already up, wait until
  2086.                     it is released, then return.
  2087.      Parameters:    The button 'button' is checked, and may be any of
  2088.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  2089.                     defined in TGEMOUSE.H.
  2090.      Return value:  None.
  2091.      Remarks:       None.
  2092.      See also:      buttonMouse(), leftButtonMouse(), rightButtonMouse(),
  2093.                     centerButtonMouse()
  2094.  
  2095.  *** Function:      setHorizLimitsMouse()
  2096.      Syntax:        void setHorizLimitsMouse(unsigned min, unsigned max);
  2097.      Purpose:       Set the minimum and maximum horizontal coordinates for
  2098.                     the pointer.
  2099.      Parameters:    The minimum horizontal coordinate will be set to 'min',
  2100.                     and the maximum to 'max'.
  2101.      Return value:  None.
  2102.      Remarks:       None.
  2103.      See also:      setVertLimitsMouse()
  2104.  
  2105.  *** Function:      setVertLimitsMouse()
  2106.      Syntax:        void setVertLimitsMouse(unsigned min, unsigned max);
  2107.      Purpose:       Set the minimum and maximum vertical coordinates for
  2108.                     the pointer.
  2109.      Parameters:    The minimum vertical coordinate will be set to 'min',
  2110.                     and the maximum to 'max'.
  2111.      Return value:  None.
  2112.      Remarks:       None.
  2113.      See also:      setHorizLimitsMouse()
  2114.  
  2115.  *** Function:      setPointerMouse()
  2116.      Syntax:        void setPointerMouse(int xOff, int yOff, void far *p);
  2117.      Purpose:       Set the shape of the pointer.
  2118.      Parameters:    The image pointed to by 'p' will be the pointer bitmap. 
  2119.                     ('xOff','yOff') is the offset, relative to the upper-
  2120.                     left corner of the bitmap, of the "hot spot" -- the
  2121.                     pixel where the pointer is actually registered as
  2122.                     being.  (For instance, the standard arrow pointer has
  2123.                     its hot spot in the upper-left, while a crosshairs
  2124.                     pointer would have it towards the middle.)
  2125.      Return value:  None.
  2126.      Remarks:       The mouse pointer should be hidden when a call to this
  2127.                     function is made.
  2128.      See also:      None.
  2129.  
  2130.  *** Function:      getSaveSizeMouse()
  2131.      Syntax:        unsigned getSaveSizeMouse(void);
  2132.      Purpose:       Return the size of the buffer necessary to store the
  2133.                     state of the mouse driver.
  2134.      Parameters:    None.
  2135.      Return value:  Returns the size of the buffer.
  2136.      Remarks:       If a program using TGE and the new mouse handling
  2137.                     routines is to run another program, for instance
  2138.                     shelling to DOS, the ensuing procedure should be
  2139.                     followed:  call disableNewMouse(), call
  2140.                     getSaveSizeMouse(), allocate a block of memory with the
  2141.                     size returned by getSaveSizeMouse(), call
  2142.                     saveStateMouse(), run the program, call
  2143.                     restoreStateMouse(), free the block of memory, then
  2144.                     call enableNewMouse().
  2145.      See also:      saveStateMouse(), restoreStateMouse()
  2146.  
  2147.  *** Function:      saveStateMouse()
  2148.      Syntax:        void saveStateMouse(void far *buf);
  2149.      Purpose:       Save the current state of the mouse driver.
  2150.      Parameters:    The block of memory pointed to by 'buf' will be used to
  2151.                     store the state data.  Its length should be obtained by
  2152.                     calling getSaveSizeMouse().
  2153.      Return value:  None.
  2154.      Remarks:       If a program using TGE and the new mouse handling
  2155.                     routines is to run another program, for instance
  2156.                     shelling to DOS, the ensuing procedure should be
  2157.                     followed:  call disableNewMouse(), call
  2158.                     getSaveSizeMouse(), allocate a block of memory with the
  2159.                     size returned by getSaveSizeMouse(), call
  2160.                     saveStateMouse(), run the program, call
  2161.                     restoreStateMouse(), free the block of memory, then
  2162.                     call enableNewMouse().
  2163.      See also:      getSaveSizeMouse(), restoreStateMouse()
  2164.  
  2165.  *** Function:      restoreStateMouse()
  2166.      Syntax:        void restoreStateMouse(void far *buf);
  2167.      Purpose:       Restore the state of the mouse driver from a buffer
  2168.                     previously filled by saveStateMouse().
  2169.      Parameters:    The block of memory pointed to by 'buf' stores the
  2170.                     state data.
  2171.      Return value:  None.
  2172.      Remarks:       If a program using TGE and the new mouse handling
  2173.                     routines is to run another program, for instance
  2174.                     shelling to DOS, the ensuing procedure should be
  2175.                     followed:  call disableNewMouse(), call
  2176.                     getSaveSizeMouse(), allocate a block of memory with the
  2177.                     size returned by getSaveSizeMouse(), call
  2178.                     saveStateMouse(), run the program, call
  2179.                     restoreStateMouse(), free the block of memory, then
  2180.                     call enableNewMouse().
  2181.      See also:      getSaveSizeMouse, saveStateMouse
  2182.  
  2183.  *** Function:      setRatioMouse()
  2184.      Syntax:        void setRatioMouse(unsigned horiz, unsigned vert);
  2185.      Purpose:       Set the mouse sensitivity, in units of mickeys per 8
  2186.                     pixels of pointer movement.  (A mickey is the unit used
  2187.                     to measure mouse movement.)
  2188.      Parameters:    The horizontal mickeys to pixels ratio will be set to
  2189.                     'horiz', and the vertical to 'vert'.
  2190.      Return value:  None.
  2191.      Remarks:       None.
  2192.      See also:      getSensitivityMouse()
  2193.  
  2194.  *** Function:      getSensitivityMouse()
  2195.      Syntax:        void getSensitivityMouse(unsigned *horiz, unsigned
  2196.                     *vert, unsigned *doubleSpeed);
  2197.      Purpose:       Get the mouse sensitivity, in units of mickeys per 8
  2198.                     pixels of pointer movement.  (A mickey is the unit used
  2199.                     to measure mouse movement.)  The mouse double speed
  2200.                     threshold (the minimum number of mickeys per second of
  2201.                     motion before pointer movement is doubled) is retrieved
  2202.                     as well.
  2203.      Parameters:    The horizontal mickeys to pixels ratio will be stored
  2204.                     in 'horiz', the vertical in 'vert', and the double
  2205.                     speed threshold in 'doubleSpeed'.
  2206.      Return value:  None.
  2207.      Remarks:       None.
  2208.      See also:      setRatioMouse()
  2209.  
  2210.  *** Function:      softResetMouse()
  2211.      Syntax:        void softResetMouse(void);
  2212.      Purpose:       Reset the mouse driver, but not the hardware.
  2213.      Parameters:    None.
  2214.      Return value:  None.
  2215.      Remarks:       This function is equivalent to resetMouse(), except in
  2216.                     that it performs no initialization of the mouse
  2217.                     hardware.
  2218.      See also:      resetMouse()
  2219.  
  2220.  
  2221.      Note that since these function names are actually macros, they may
  2222.      easily be changed to suit individual preferences by editing
  2223.      TGEMOUSE.H.
  2224.  
  2225.  
  2226.  
  2227. ADDITIONAL FEATURES IN THE REGISTERED VERSION
  2228. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2229.  
  2230.      In addition to technical support and usage rights, registered users
  2231.      may use the registered version of TGE.  Not only does the registered
  2232.      version of TGE include complete source code for the TGE library and an
  2233.      extra font not found in the shareware version, it also includes some
  2234.      features not available in the shareware verion:
  2235.  
  2236.      Registered users can save up to about 22 kb of memory by selectively
  2237.      commenting out #defines in TGE.H and compiling the TGE library.
  2238.      Following is a list of symbols and the features they disable when
  2239.      they're not #defined:
  2240.           TGE_USE_VIRTUAL_SCREENS       Virtual screen support.
  2241.           TGE_USE_OUTPUT_MODES          Output mode support.
  2242.           TGE_USE_REGION_FILLS          fillRegion().
  2243.           TGE_USE_IMAGES                Bitmap-related functions.
  2244.           TGE_USE_ELLIPSES              ellipse- and circle-drawing.
  2245.           TGE_USE_COLOUR_APPROXIMATION  colourCloseTo() and
  2246.                                         colourCloseToX().
  2247.           TGE_USE_LOADGRAPHDRIVER       loadGraphDriver() and
  2248.                                         unloadGraphDriver().
  2249.      The source for the disabled features is simply not compiled, and so
  2250.      does not waste space in the executable or in memory.  Remember to
  2251.      recompile the TGE library after making a change!
  2252.  
  2253.  
  2254.  
  2255. CREATING FONTS
  2256. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2257.  
  2258.      Creating fonts is not easy, but the necessary information is outlined
  2259.      below.
  2260.  
  2261.      For variable-size 256-colour fonts:
  2262.      ──────────────────────────────────
  2263.           First, you should make a working directory for your font's data
  2264.           files.  For the sake of example, I will assume that you are
  2265.           trying to create MYFONT.FNT.
  2266.  
  2267.           Second, draw a bitmap for each of the 256 ASCII characters which
  2268.           you would like to exist in the font; if you won't be using a
  2269.           character, feel free to not bother drawing a bitmap for it.  Each
  2270.           bitmap should be as small as possible, so be sure not to leave
  2271.           any extra space around the character.  Use colour zero as the
  2272.           background colour, or some other colour if you would like the
  2273.           font to have a coloured background.  Save each of these bitmaps
  2274.           as a PCX file in the working directory.  Note that all character
  2275.           bitmaps must use the same colour palette.
  2276.  
  2277.           Third, convert the PCX files to RAW files by using PCX2RAW; to do
  2278.           so, type 'PCX2RAW *'.
  2279.  
  2280.           Fourth, you must rename one of the PAL files produced by PCX2RAW
  2281.           to MYFONT.PAL (remember MYFONT.FNT is the font you're creating).
  2282.           If you wish, you may delete all the other PAL files, so long as
  2283.           you leave MYFONT.PAL intact.
  2284.  
  2285.           Fifth, you must create MYFONT.OFF, the character offset
  2286.           description file.  This text file consists of 256 lines, each
  2287.           containing a single integer (either positive or zero), followed
  2288.           by a newline.  Each line contains its corresponding character's
  2289.           "offset from top" value; the first line is for character 0, the
  2290.           second is for character 1, and so on.  Given the (x,y)
  2291.           coordinates at which to put a character from the font, the
  2292.           "offset from top" is the value to add to the y coordinate before
  2293.           putImageInv() is called to display the character's bitmap.  The
  2294.           "offset from top" is used to make character bitmaps be written
  2295.           lower down on the screen than other bitmaps; for instance, the
  2296.           period character's offset would be greater than an asterisk's
  2297.           offset, because a period is lower down than an asterisk.
  2298.  
  2299.           Finally, you must create the font file MYFONT.FNT; to do so, type
  2300.           'MAKEFONT myfont'.
  2301.  
  2302.  
  2303.      For fixed-size monochrome fonts:
  2304.      ───────────────────────────────
  2305.           TGE's font definition files must have a certain format which will
  2306.           be outlined below.  (Note that a fixed font consists of 256
  2307.           monochrome characters, each with the same dimensions.)
  2308.  
  2309.           The font file header consists of three fields of defined length.
  2310.           The first of these fields is the eight-byte font definition file
  2311.           signature string, which must be "TGEFONT1", without quotes or
  2312.           terminating null character.  The next field is a two-byte
  2313.           unsigned integer which holds the width of a character in pixels.
  2314.           The last field is also a two-byte integer, holding the height of
  2315.           a character in pixels.
  2316.  
  2317.           The remainder of the file consists of font data.  (If you have
  2318.           done advanced text programming before, you may recognize this
  2319.           data organization as the format used by the video BIOS.)  The
  2320.           characters are stored starting at character 0, all the way up to
  2321.           255.  Each of the characters is stored starting with the
  2322.           uppermost row, all the way down to the bottom row.  Each row is
  2323.           stored left to right, with the leftmost pixel in the most
  2324.           significant bit of the first byte in the row, and the rightmost
  2325.           pixel in the least significant bit of the last byte in the row.
  2326.           A 1 bit represents a foreground pixel, while a 0 bit represents a
  2327.           background pixel.  Note that, at present, font row widths must be
  2328.           evenly divisible by 8; pad with 0 bits if necessary.
  2329.  
  2330.           Image data for all 256 of the ASCII characters must be present in
  2331.           the file; if you won't be needing some of them, feel free to
  2332.           store zero bytes (or random bytes, if you're imaginative) as
  2333.           their image data.
  2334.  
  2335.  
  2336.  
  2337. USING PCX2RAW AND GRAPHICS FILES
  2338. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2339.  
  2340.      The PCX2RAW utility provides a simple way to convert 256-colour images
  2341.      in PCX format into a format usable by TGE.  It is used like this:
  2342.  
  2343.           pcx2raw filename[.pcx]
  2344.  
  2345.      Given the PCX file FILENAME.PCX, PCX2RAW will create two new files in
  2346.      the same directory as FILENAME.PCX:  FILENAME.PAL which contains the
  2347.      colour palette from FILENAME.PCX, and FILENAME.RAW which is a TGE
  2348.      format bitmap of the image in FILENAME.PCX.  Following is a discussion
  2349.      of the PAL and RAW file formats, and how to use TGE's functions to
  2350.      access them.
  2351.  
  2352.  
  2353.      The PAL file is organized like this:
  2354.  
  2355.          Element size    Element description
  2356.          ------------    -------------------
  2357.            3 bytes           colour 0
  2358.            3 bytes           colour 1
  2359.                         .
  2360.                         .
  2361.                         .
  2362.            3 bytes           colour 254
  2363.            3 bytes           colour 255
  2364.  
  2365.      Each 3-byte element consists of the red, green, and blue colour
  2366.      components, in that order.  Each of these components is an unsigned
  2367.      char.  Code to load a PAL file is included in RAWFILE.C; the function
  2368.      description follows:
  2369.  
  2370.  *** Function:      loadPalFile()
  2371.      Syntax:        void far *loadPalFile(char *filename, void far *addr);
  2372.      Purpose:       Load a 768-byte palette file into memory.
  2373.      Parameters:    The palette data file 'filename' will be loaded into
  2374.                     the memory block at 'addr' (if 'addr' != NULL), or into
  2375.                     a newly allocated memory block (if 'addr' == NULL).
  2376.      Return value:  Returns the address of the loaded palette on success,
  2377.                     or NULL on error.
  2378.      Remarks:       If 'addr' is NULL, be sure to free() the allocated
  2379.                     memory block when the palette information is no longer
  2380.                     needed.
  2381.      See also:      loadPcxFilePal(), loadRawFile(), displayRawFile(),
  2382.                     loadPcxFile(), displayPcxFile()
  2383.  
  2384.  
  2385.      The RAW file is organized in exactly the same way as the bitmaps used
  2386.      by putImage() and its associated functions:  2 bytes for the image
  2387.      width, then 2 bytes for the image height, then width*height bytes (one
  2388.      per pixel) for the image information itself; the pixels are in order
  2389.      from left to right and from top to bottom, as one would read a book.
  2390.      The image dimension fields are both unsigned shorts, and are measured
  2391.      in pixels.  Code to deal with RAW files is included in RAWFILE.C; the
  2392.      function descriptions follow:
  2393.  
  2394.  *** Function:      loadRawFile()
  2395.      Syntax:        void far *loadRawFile(char *filename);
  2396.      Purpose:       Load a RAW image file into memory.
  2397.      Parameters:    The RAW image file 'filename' will be loaded into a
  2398.                     newly allocated memory block.
  2399.      Return value:  Returns the address of the loaded image on success, or
  2400.                     NULL on error.
  2401.      Remarks:       Be sure to free() the allocated memory block when the
  2402.                     image information is no longer needed.
  2403.      See also:      saveRawFile(), displayRawFile(), loadPcxFile(),
  2404.                     loadPalFile()
  2405.  
  2406.  *** Function:      displayRawFile()
  2407.      Syntax:        int displayRawFile(int x, int y, char *filename);
  2408.      Purpose:       Display a RAW image file.
  2409.      Parameters:    The RAW image file 'filename' will be displayed with
  2410.                     its upper-left corner at ('x','y').  Clipping is
  2411.                     performed.
  2412.      Return value:  Returns the 1 on success, or 0 on error.
  2413.      Remarks:       Since this function uses standard TGE output routines,
  2414.                     it can display to virtual screens as well as the real
  2415.                     screen.
  2416.      See also:      loadRawFile(), displayPcxFile(), loadPalFile()
  2417.  
  2418.  *** Function:      saveRawFile()
  2419.      Syntax:        int saveRawFile(char *filename, void *image);
  2420.      Purpose:       Save a RAW image to disk.
  2421.      Parameters:    The image at 'image' will be written to the RAW image
  2422.                     file 'filename'.
  2423.      Return value:  Returns 0 on error.
  2424.      Remarks:       None.
  2425.      See also:      loadRawFile(), loadPcxFile(), displayRawFile()
  2426.  
  2427.  
  2428.      TGE also includes routines to deal directly with PCX files:
  2429.  
  2430.  *** Function:      loadPcxFilePal()
  2431.      Syntax:        void far *loadPcxFilePal(char *filename, void far *addr);
  2432.      Purpose:       Load a 768-byte palette from a PCX file into memory.
  2433.      Parameters:    The palette data 'filename' will be loaded into the
  2434.                     memory block at 'addr' (if 'addr' != NULL), or into a
  2435.                     newly allocated memory block (if 'addr' == NULL).
  2436.      Return value:  Returns the address of the loaded palette on success,
  2437.                     or NULL on error.
  2438.      Remarks:       If 'addr' is NULL, be sure to free() the allocated
  2439.                     memory block when the palette information is no longer
  2440.                     needed.
  2441.      See also:      loadPalFile(), loadPcxFile(), displayPcxFile(),
  2442.                     loadRawFile(), displayRawFile()
  2443.  
  2444.  *** Function:      loadPcxFile()
  2445.      Syntax:        void far *loadPalFile(char *filename, void *palette);
  2446.      Purpose:       Load a PCX image file, and its palette if requested,
  2447.                     into memory.
  2448.      Parameters:    The PCX image file 'filename' will be loaded into a
  2449.                     newly allocated memory block.  If 'palette' is
  2450.                     non-NULL, the 768 bytes of palette data from the PCX
  2451.                     file will be loaded into the memory area at 'palette'.
  2452.      Return value:  Returns the address of the loaded image on success, or
  2453.                     NULL on error.  If 'palette' was non-NULL, a copy of
  2454.                     the palette will be at the memory area pointed to by
  2455.                     'palette' on return.
  2456.      Remarks:       Be sure to free() the allocated memory block when the
  2457.                     image information is no longer needed.
  2458.      See also:      displayPcxFile(), loadPcxFilePal(), loadRawFile(),
  2459.                     displayRawFile(), loadPalFile()
  2460.  
  2461.  *** Function:      displayPcxFile()
  2462.      Syntax:        int displayPcxFile(int x, int y, char *filename);
  2463.      Purpose:       Display a PCX image file.
  2464.      Parameters:    The PCX image file 'filename' will be displayed with
  2465.                     its upper-left corner at ('x','y').  Clipping is
  2466.                     performed.
  2467.      Return value:  Returns the 1 on success, or 0 on error.
  2468.      Remarks:            Since this function uses standard TGE output
  2469.                     routines, it can display to virtual screens as well as
  2470.                     the real screen.
  2471.                          The image is displayed using the current palette,
  2472.                     which is not necessarily the same as that of the PCX
  2473.                     file.
  2474.      See also:      loadPcxFile(), displayRawFile(), loadRawFile()
  2475.  
  2476.  
  2477.  
  2478. CONTACTING THE AUTHOR
  2479. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2480.  
  2481.      I would appreciate hearing any questions, comments, bug reports, or
  2482.      suggestions for improvement.  If you have any, feel free to contact
  2483.      me; I can be reached via any of the methods below.  When reporting
  2484.      bugs, please be sure to mention the version of TGE to which you are
  2485.      referring; also, if possible, please include detailed descriptions of
  2486.      the problem and of your video hardware configuration.  If you have a
  2487.      video card which is not directly supported by TGE, I would appreciate
  2488.      it if you would send me programming information about your card and/or
  2489.      code to deal with it.
  2490.  
  2491.           Snail mail:      Matthew Hildebrand
  2492.                            4 College St.
  2493.                            St. Catharines, ON
  2494.                            Canada   L2R 2W7
  2495.  
  2496.           Fidonet mail:    1:247/128.2
  2497.                Please do not post personal messages to me in any of the
  2498.                Fidonet echos, such as C_ECHO or C_PLUSPLUS; such messages
  2499.                are off-topic and liable to annoy the moderator and other
  2500.                echo participants.  Use netmail instead.  If I find any such
  2501.                personal messages in Fidonet programming echos, I reply by
  2502.                netmail only.  If the matter being discussed would be of
  2503.                interest to other echo participants, I will reply in that
  2504.                echo.
  2505.  
  2506.           Internet mail:   Matthew.Hildebrand@p2.f128.n247.z1.fidonet.org
  2507.                Internet-Fidonet mail routing sometimes goes awry; if you
  2508.                don't get a reply from me after a reasonable amount of time,
  2509.                send the message again.  If you still don't receive a reply,
  2510.                either persist until you do or contact me via a different
  2511.                method.
  2512.  
  2513.           BBS:             (905)-935-6628
  2514.                I am not the sysop of idiot savant BBS, but I will receive
  2515.                messages left there for me.  The BBS runs a 14400 bps
  2516.                V.32bis modem.
  2517.  
  2518.           Telephone:       (905)-687-8736
  2519.                Please keep in mind the time zone difference, if any, when
  2520.                calling; I'm in Eastern Standard Time.
  2521.  
  2522.  
  2523.  
  2524. OBTAINING THE NEWEST VERSION OF TGE
  2525. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2526.  
  2527.      The most recent distributed copy of TGE is available via first-call
  2528.      download from (905)-935-6628 (14400 bps V.32bis), or via file request
  2529.      from Fidonet node 1:247/128 (14400 bps V.32bis) using the magic file
  2530.      name "TGE"; unlisted nodes and points are welcome.  TGE is also
  2531.      distributed through the Fidonet file echo PDNCEE.
  2532.  
  2533.      If, after you have registered, you are interested in receiving new
  2534.      versions of TGE as they are released, an easy method is now available.
  2535.      For $3 per mailing (to cover the disk, envelope, and postage), I will
  2536.      mail copies of new versions as they are released, on either a 3.5" or
  2537.      a 5.25" disk.  The $3 per mailing may be included with the initial
  2538.      registration fee, with instructions to mail newer versions as they are
  2539.      released, or mailed later with a request for a copy of the newest
  2540.      version.  Please ensure that the $3 is paid in either US or Canadian
  2541.      funds; payment by cash, money order (use an international money order
  2542.      if necessary), or cheque drawn on a US or Canadian bank is acceptable.
  2543.  
  2544.      Alternatively, it is possible to receive notifications of updates but
  2545.      not the updates themselves.  For $1 per mailing (to cover the envelope
  2546.      and postage), I will mail notifications of new versions when they are
  2547.      released.  The $1 per mailing may be included with the initial
  2548.      registration fee, with instructions to mail notifications as new
  2549.      versions are released, or mailed later with similar instructions.
  2550.      Again, please ensure that the $1 is paid in either US or Canadian
  2551.      funds; payment by cash, money order (use an international money order
  2552.      if necessary), or cheque drawn on a US or Canadian bank is acceptable.
  2553.  
  2554.  
  2555.  
  2556. KNOWN PROBLEMS USING TGE
  2557. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2558.  
  2559.      At present, the following problems may be experienced when using TGE:
  2560.  
  2561.           1.   (Registered users only.)  When TGEFUNCS.C is compiled by
  2562.                Turbo C++ 3.0, putImage() and putImageInv() do not work
  2563.                correctly. When informed of this bug, I stepped through the
  2564.                offending code at the assembly level, and discovered that
  2565.                this problem is caused by a bug in TC++, not TGE.  The
  2566.                miscompiled lines of TGE.C are perfectly legal C statements;
  2567.                when TGE.C is compiled by my compiler (Borland C++ 2.0), TGE
  2568.                works beautifully.  Using one of the TGE library files
  2569.                included in the TGE package, rather than OBJ files compiled
  2570.                by Turbo C++ 3.0, should solve the problem.
  2571.           2.   A very small number of users may experience an odd pattern
  2572.                of blue lines when TGE is run in an SVGA mode on some older
  2573.                ATI cards.  I have been informed that this problem is caused
  2574.                by a bug in the video card itself.  ATI has confirmed the
  2575.                presence of this bug, and has implemented a software patch
  2576.                in its Windows 3.1 SVGA driver, but ATI has not released
  2577.                information on how this bug was squashed.
  2578.  
  2579.  
  2580.  
  2581. ACKNOWLEDGEMENT
  2582. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2583.  
  2584.      There are many people whom I would like to thank for their
  2585.      suggestions, beta-testing, patience, registrations, and help with
  2586.      distribution.  You know who you are.
  2587.  
  2588.  
  2589.  
  2590. LEGAL STUFF
  2591. ▀▀▀▀▀▀▀▀▀▀▀
  2592.  
  2593.      The Graphics Engine and its documentation are Copyright (c) 1993-1994
  2594.      by Matthew Hildebrand.
  2595.  
  2596.      All software and documentation associated with The Graphics Engine is
  2597.      provided "as is":  ie., it is provided without warranty of any kind,
  2598.      not even an implied warranty of merchantability or fitness for any
  2599.      purpose.  The Author (Matthew Hildebrand) disclaims all warranties,
  2600.      both express and implied, including but not limited to warranties
  2601.      regarding The Graphics Engine's merchantability or fitness for any
  2602.      particular purpose.
  2603.  
  2604.      The author may not be held liable for any damage or misfortune related
  2605.      to the use of this software.  Any usage of any or all of The Graphics
  2606.      Engine is done entirely at the user's risk.
  2607.  
  2608.      All registered trademarks in this document belong to their respective
  2609.      owners.
  2610.  
  2611.  
  2612.  
  2613. End of document.
  2614.